在Linux中使用rpcinfo检查NFS服务状态时,需通过以下步骤验证RPC服务注册情况:
-
本地服务检查:执行
rpcinfo -p
或rpcinfo -p localhost
,观察输出中是否包含nfs
、mountd
、nlockmgr
等关键服务,状态应为“已注册”且端口正常。 -
远程服务探测:使用
rpcinfo -u <NFS_Server_IP> nfs
(UDP)或rpcinfo -t <NFS_Server_IP> nfs
(TCP),若返回版本号列表(如nfs v3/v4),则表明服务可达。 -
深度分析:结合
systemctl status nfs-server
确认服务进程状态,并通过防火墙规则(firewall-cmd
或iptables
)验证端口111(rpcbind)及2049(nfs)是否开放。
异常排查重点:若rpcinfo无响应,需优先检查rpcbind服务是否运行,其次排查网络隔离策略及NFS配置文件的导出权限(/etc/exports)。