How to set-up reliable NFS server



We have 2 server machines (Server1, Server2), they backup each other using keepalived. We have NFS servers (nfs-kernel-server) running on each of servers.
We have a client PC which mounts NFS share like this:
Code: on /misc/acsd type nfs4 (rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=1200,retrans=2,sec=sys,clientaddr=,local_lock=none,addr= - is a keepalived interface for both servers.
When we shut down Server1 - NFS mounting breaks like this:
ls: cannot open directory .: Stale NFS file handle
If we remount just after this - everything works ok, I can see files from Server2. Something breaks when keepalived switches servers.
Is there a way to fix that?

You need to export the location with the fsid option. Once you do that and remount it things should fail over properly. Make sure that since you are using NFSv4 not to use the fsid=0.

Members online

Latest posts