NFS启动失败

简介: Failed to listen on RPCbind Server Activation Socket

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
目录
相关文章
|
5月前
|
Linux 网络安全
NFS 服务器安装
NFS(Network File System)网络文件系统,它最大的功能就是可以通过网络,让不同的机器、不同的操作系统可以共享彼此的文件。当我们在 NFS 服务器设置好一个共享目录后,其他的有权访问 NFS 客户端就可以将这个共享目录挂载到文件系统自定义的挂载点,挂载好后客户端在本地能够看到服务端共享目录中的所有数据
87 1
|
7月前
|
Unix
|
域名解析 网络协议 Unix
NFS服务器详解
NFS服务器详解
1309 0
|
存储 网络协议 Linux
NFS服务配置
NFS会经常用到,用于在网络上共享存储。这样讲,你对NFS可能不太了解,举一个例子来说明一下NFS是用来做什么的。假如有三台机器A, B, C,它们需要访问同一个目录,目录中都是图片,传统的做法是把这些图片分别放到A, B, C. 但是使用NFS只需要放到A上,然后A共享给B和C即可。访问的时候,B和C是通过网络的方式去访问A上的那个目录的。
383 0
NFS服务配置