今天碰到个问题,服务器重启后,nfs服务就启动不了了,关闭都关不了。查看系统日志报下面的错:
Aug 10 17:08:53 prod-r3-slt-s-01 systemd: Started Preprocess NFS configuration.
Aug 10 17:08:53 prod-r3-slt-s-01 systemd: Starting NFS status monitor for NFSv2/3 locking....
Aug 10 17:08:53 prod-r3-slt-s-01 systemd: Starting NFSv4 ID-name mapping service...
Aug 10 17:08:53 prod-r3-slt-s-01 rpc.statd[20430]: Version 1.3.0 starting
Aug 10 17:08:53 prod-r3-slt-s-01 systemd: Starting NFS Mount Daemon...
Aug 10 17:08:53 prod-r3-slt-s-01 rpc.statd[20430]: Flags: TI-RPC
Aug 10 17:08:53 prod-r3-slt-s-01 rpc.mountd[20431]: Could not bind socket: (98) Address already in use
Aug 10 17:08:53 prod-r3-slt-s-01 rpc.mountd[20431]: Could not bind socket: (98) Address already in use
Aug 10 17:08:53 prod-r3-slt-s-01 rpc.mountd[20431]: Could not bind socket: (98) Address already in use
Aug 10 17:08:53 prod-r3-slt-s-01 rpc.mountd[20431]: Could not bind socket: (98) Address already in use
Aug 10 17:08:53 prod-r3-slt-s-01 rpc.mountd[20431]: mountd: No V2 or V3 listeners created!
Aug 10 17:08:53 prod-r3-slt-s-01 systemd: Started NFS Mount Daemon.
Aug 10 17:08:53 prod-r3-slt-s-01 rpc.mountd[20432]: Version 1.3.0 starting
Aug 10 17:08:53 prod-r3-slt-s-01 systemd: Started NFSv4 ID-name mapping service.
Aug 10 17:08:53 prod-r3-slt-s-01 rpc.statd[20430]: Failed to register (statd, 1, udp): svc_reg() err: RPC: Remote system error - No route to host
Aug 10 17:08:53 prod-r3-slt-s-01 rpc.statd[20430]: Failed to register (statd, 1, tcp): svc_reg() err: RPC: Remote system error - No route to host
Aug 10 17:08:53 prod-r3-slt-s-01 rpc.statd[20430]: Failed to register (statd, 1, udp6): svc_reg() err: RPC: Remote system error - No route to host
Aug 10 17:08:53 prod-r3-slt-s-01 rpc.statd[20430]: Failed to register (statd, 1, tcp6): svc_reg() err: RPC: Remote system error - No route to host
Aug 10 17:08:53 prod-r3-slt-s-01 rpc.statd[20430]: failed to create RPC listeners, exiting
Aug 10 17:08:53 prod-r3-slt-s-01 systemd: rpc-statd.service: control process exited, code=exited status=1
Aug 10 17:08:53 prod-r3-slt-s-01 systemd: Failed to start NFS status monitor for NFSv2/3 locking..
Aug 10 17:08:53 prod-r3-slt-s-01 systemd: Unit rpc-statd.service entered failed state.
Aug 10 17:08:53 prod-r3-slt-s-01 systemd: rpc-statd.service failed.
Aug 10 17:08:53 prod-r3-slt-s-01 systemd: Starting NFS server and services...
然后发现查看外国网站找到了一个解决办法:
systemctl enable rpcbind
systemctl start rpcbind
systemctl start nfs-server