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.
但是当’rpcbind’服务没有运行时,我无法启动NFS恶魔:
# 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]
我已禁用NFS v2和v3:
# grep -v "^#" /etc/sysconfig/nfs MOUNTD_NFS_V2="no" MOUNTD_NFS_V3="no" RPCNFSDARGS="-N 2 -N 3"
您能否确认下面列出的服务器和客户端需要/必要的服务(基本上我想禁用不需要的服务):
# 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
解决方法
从内核3.14开始,不再需要rpcbind来运行内核NFS服务器.
(假设服务器配置为仅使用NFSv4及更高版本)
http://lxr.free-electrons.com/source/net/sunrpc/svc.c?v=3.14#L966
您可以在此主题中找到有关该更改的更多信息:
http://www.spinics.net/lists/linux-nfs/msg41053.html
因此,您的配置:
MOUNTD_NFS_V2="no" MOUNTD_NFS_V3="no" RPCNFSDARGS="-N 2 -N 3"
现在应该没有rpcbind工作.
仅使用NFSv4时,不需要以下任何服务:
/etc/rc.d/init.d/nfslock /etc/rc.d/init.d/rpcgssd /etc/rc.d/init.d/rpcidmapd /etc/rc.d/init.d/rpcsvcgssd