NFS启动失败

1、检查NFS状态无法启动了

[root@nfs ~]# systemctl status nfs
● nfs-server.service - NFS server and services
   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled; vendor preset: disabled)
  Drop-In: /run/systemd/generator/nfs-server.service.d
           └─order-with-mounts.conf
   Active: failed (Result: exit-code) since Tue 2019-12-10 20:48:42 CST; 10s ago
  Process: 11817 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=1/FAILURE)
  Process: 11815 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
 Main PID: 11817 (code=exited, status=1/FAILURE)

Dec 10 20:48:42 nfs.ss.com systemd[1]: Starting NFS server and services...
Dec 10 20:48:42 nfs.ss.com rpc.nfsd[11817]: rpc.nfsd: writing fd to kernel failed: errno 111 (Connection refused)
Dec 10 20:48:42 nfs.ss.com systemd[1]: nfs-server.service: main process exited, code=exited, status=1/FAILURE
Dec 10 20:48:42 nfs.ss.com rpc.nfsd[11817]: rpc.nfsd: unable to set any sockets for nfsd
Dec 10 20:48:42 nfs.ss.com systemd[1]: Failed to start NFS server and services.
Dec 10 20:48:42 nfs.ss.com systemd[1]: Unit nfs-server.service entered failed state.
Dec 10 20:48:42 nfs.ss.com systemd[1]: nfs-server.service failed.

2、查看rpcbind(rpcbind和nfs之间的关系自行百度)

[root@nfs ~]# systemctl stop rpcbind
[root@nfs ~]# systemctl start rpcbind
A dependency job for rpcbind.service failed. See 'journalctl -xe' for details.
Dec 10 20:49:47 nfs.host.com polkitd[9323]: Registered Authentication Agent for unix-process:12926:44289 (system bus name :1.1184 [/
Dec 10 20:49:47 nfs.host.com polkitd[9323]: Unregistered Authentication Agent for unix-process:12926:44289 (system bus name :1.1184,
Dec 10 20:49:51 nfs.host.com polkitd[9323]: Registered Authentication Agent for unix-process:12932:44730 (system bus name :1.1185 [/
Dec 10 20:49:51 nfs.host.com systemd[1]: rpcbind.socket failed to listen on sockets: Address family not supported by protocol
Dec 10 20:49:51 nfs.host.com systemd[1]: **Failed to listen on RPCbind Server Activation Socket.
-- Subject: Unit rpcbind.socket has failed**

发现rpcbind也无法启动,提示Failed to listen on RPCbind Server Activation Socket

3、尝试禁用ipv6

[root@nfs ~]# vim /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
[root@nfs ~]# sysctl -p

4、修改rpcbind服务的socket文件监听的地址

[root@nfs ~]# find /etc -name '*rpcbind.socket*'
/etc/systemd/system/sockets.target.wants/rpcbind.socket
[root@nfs ~]# vim /etc/systemd/system/sockets.target.wants/rpcbind.socket
[Unit]
Description=RPCbind Server Activation Socket
[Socket]
ListenStream=/var/run/rpcbind.sock
RPC netconfig can't handle ipv6/ipv4 dual sockets
BindIPv6Only=ipv6-only
ListenStream=0.0.0.0:111
Listen~gram=0.0.0.0:111
**#ListenStream=[::]:111   #注释掉**
**#Listen~gram=[::]:111    #注释掉**

5、重载、重启

[root@nfs ~]# systemctl daemon-reload 
[root@nfs ~]# systemctl restart rpcbind
[root@nfs ~]# systemctl restart nfs
上一篇:理解Docker(6):若干企业生产环境中的容器网络方案


下一篇:云上创新时代:云原生加速数字化转型创新,开发者黄金时代即将到来!