NFSv4 not able to set any sockets for nfsd without running rpcbind
According to Red Hat docs 'rpcbind' is not required any more:
Because protocol support has been incorporated into the v4 protocol, NFSv4 has no interaction with the portmap, rpc.lockd, and rpc.statd daemons. NFSv4 listens on the well-known TCP port 2049, which eliminates the need for portmap interaction. The mounting and locking protocols have been incorporated into the V4 protocol which eliminates the need for interaction with rpc.lockd and rpc.statd. The rpc.mountd daemon is still required on the server, but is not involved in any over-the-wire operations.
however I'm not able to start NFS demon when 'rpcbind' service is not running:
# service nfs start
Starting NFS services: [ OK ]
Starting NFS quotas: Cannot register service: RPC: Unable to receive; errno = Connection refused
rpc.rquotad: unable to register (RQUOTAPROG, RQUOTAVERS, udp).
[FAILED]
Starting NFS mountd: [ OK ]
Starting NFS daemon: rpc.nfsd: writing fd to kernel failed: errno 111 (Connection refused)
rpc.nfsd: unable to set any sockets for nfsd
[FAILED]
I've disabled NFS v2 and v3:
# grep -v "^#" /etc/sysconfig/nfs
MOUNTD_NFS_V2="no"
MOUNTD_NFS_V3="no"
RPCNFSDARGS="-N 2 -N 3"
Could you please confirm what services are required/essential on server and client from these listed below (basically I would like to disable services which are not needed):
# rpm -ql nfs-utils | grep 'init.d'
/etc/rc.d/init.d/nfs
/etc/rc.d/init.d/nfslock
/etc/rc.d/init.d/rpcgssd
/etc/rc.d/init.d/rpcidmapd
/etc/rc.d/init.d/rpcsvcgssd
Solution 1:
This was a bug in NFS server kernel module. It was patched in December 2013.
Starting with kernel 3.14, rpcbind
is no longer required to run in-kernel NFS server.
(assuming that server is configured to use only NFSv4 and higher)
http://lxr.free-electrons.com/source/net/sunrpc/svc.c?v=3.14#L966
You can find more information about that change in this thread:
http://www.spinics.net/lists/linux-nfs/msg41053.html
Therefore, your configuration:
MOUNTD_NFS_V2="no"
MOUNTD_NFS_V3="no"
RPCNFSDARGS="-N 2 -N 3"
should now work without rpcbind
.
When you use only NFSv4, none of these services are required:
/etc/rc.d/init.d/nfslock
/etc/rc.d/init.d/rpcgssd
/etc/rc.d/init.d/rpcidmapd
/etc/rc.d/init.d/rpcsvcgssd