由于做了入方向的端口限制导致原来的NFS无法挂载需要放行端口。这时候发现NFS的端口除了111、2049外其他都是随机大端口如果要用安全组限制必须指定端口编辑/etc/nfs.conf只附上内容理论不介绍了[lockd] port30005 udp-port30005 [mountd] port30001 [statd] port30002 outgoing-port30003改完配置文件就需要重启nfs-server 和rpcbind这时候遇到问题rpcbind在stop后抛出异常“Warning: Stopping rpcbind.service, but it can still be activated by: rpcbind.socket”查看服务状态实际还是activestop没有执行成功。核心问题rpcbind.socket 是套接字激活单元只停 rpcbind.service 会自动重启解决方案1. 彻底停止避免自动拉起# 先停socket激活单元 systemctl stop rpcbind.socket # 再停主服务 systemctl stop rpcbind.service # 禁止开机自启可选仅本次操作不用 systemctl disable rpcbind.socket rpcbind.service2、启动nfs-server 和rpcbind# 先启动rpcbind再启动nfs systemctl start rpcbind.socket systemctl start rpcbind.service systemctl start nfs-server3、验证端口是否固定成功rpcinfo -p