Dec 01 06:19:12 iZ2zef2lpf67qo7tbnrwlaZ systemd[1]: rpcbind.socket failed to listen on sockets: Address family not supported by protocol
Dec 01 06:19:12 iZ2zef2lpf67qo7tbnrwlaZ systemd[1]: Failed to listen on RPCbind Server Activation Socket.
于是谷歌看了一下;发现是ipv6没开启导致的;修改/etc/sysctl.d/sysctl.conf
[root@BZ ~]# less /etc/sysctl.conf | grep ‘net.ipv6’
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
[root@BZ ~]# sysctl -p #重新加载一下配置;临时生效
[root@BZ ~]# systemctl start rpcbind #重启rpcbind服务
[root@BZ ~]# systemctl start nfs #重启nfs服务
再挂载nfs文件就ok了。
措施二:
[root@BZ ~]# find /etc/ -name '*rpcbind.socket*'
找到这个socket文件,并用vim编译器编辑它。
[Unit]
Description=RPCbind Server Activation Socket
[Socket]
ListenStream=/var/run/rpcbind.sock
ListenStream=[::]:111 #果然监听了ipv6地址,将这一行注释即可
ListenStream=0.0.0.0:111
BindIPv6Only=ipv6-only
[Install]
WantedBy=sockets.target
重载一下再启动
[root@BZ ~]# systemctl daemon-reload
[root@BZ ~]# systemctl restart rpcbind.socket
[root@BZ ~]# systemctl start nfs
再挂载远程nfs即可。