NFSv4 clients hang when the NFS server is gone

I am operating some NFSv4 Servers, .. but, someday, I reboot NFS Servers in out of awarence .. then, NFS Clients was hangs when approaches to the NFS Mount points

I am operating some NFSv4 servers, but sometimes I reboot NFS servers (why?), causing NFS clients to hang when trying to approach the NFS mountpoints.

  1. umount / umount -f does not work
  2. Even when I reboot some NFS clients, they still hang on the way to shutdown
  3. OS is FreeBSD 9.1-p2 (server and clients)
  4. NFS configuration is below
Code:
[server]
 rpcbind_enable="YES"
 nfs_server_enable="YES"
 nfsv4_server_enable="YES"
 nfsuserd_enable="YES"  # Client also needed
 mountd_enable="YES"
 mountd_flags="-r"
 
 rpc_lockd_enable="YES"
 rpc_statd_enable="YES"

[clients]
 rpcbind_enable="YES"
 nfs_client_enable="YES"
 nfsuserd_enable="YES"
  • What's wrong?
  • Can I solve these hanging situations?
  • Please tell me how to avoid these situations. When the server is gone, clients should not hang and recover automatically when the server comes back (reboots).

Thank you.
 
Have a look in the mount_nfs(8) man page:
Code:
     If the server becomes unresponsive while an NFS file system is mounted,
     any new or outstanding file operations on that file system will hang
     uninterruptibly until the server comes back.  To modify this default be-
     haviour, see the intr and soft options.
 
And what does it mean?
Code:
BUGS
     Since nfsv4 performs open/lock operations that have their ordering
     strictly enforced by the server, the options intr and soft cannot be
     safely used.  hard nfsv4 mounts are strongly recommended.
 
Same problem with FreeBSD 10.1 amd64.
I have one client connected to two servers. If one server go away, client hangs until server come back.

Any workarounds?
 
Yes that is called statefull NFS. It is expected behaviour. Use NFS3. What problem are you traying to solve with NFSv4 anyway?
 
My app push files to multiple nodes that mounted via NFS.

Looks like I must use NFS soft mount option.
With care, of course.
 
Last edited:
Back
Top