NFS RPC: Port mapper failure - RPC: Unable to receive

解决NFS挂载失败问题

NFS mount远端export的目录时报错:

RPC: Port mapper failure - RPC: Unable to receive

仔细检查了一下远端服务,portmap和nfs都启动了,showmount –e 192.168.11.101也报同样的错,在服务器端使用rpcinfo检查:

rpcinfo –p 192.168.11.101 结果看似正常

程序        版本 协议   端口
100000    2   tcp    111  portmapper
100000    2   udp    111  portmapper
100024    1   udp    876  status
100024    1   tcp    879  status
100011    1   udp    747  rquotad
100011    2   udp    747  rquotad
100011    1   tcp    750  rquotad
100011    2   tcp    750  rquotad
100003    2   udp   2049  nfs
100003    3   udp   2049  nfs
100003    4   udp   2049  nfs
100021    1   udp  60716  nlockmgr
100021    3   udp  60716  nlockmgr
100021    4   udp  60716  nlockmgr
100003    2   tcp   2049  nfs
100003    3   tcp   2049  nfs
100003    4   tcp   2049  nfs
100021    1   tcp  41781  nlockmgr
100021    3   tcp  41781  nlockmgr
100021    4   tcp  41781  nlockmgr
100005    1   udp    791  mountd
100005    1   tcp    794  mountd
100005    2   udp    791  mountd
100005    2   tcp    794  mountd
100005    3   udp    791  mountd
100005    3   tcp    794  mountd

想起是不是iptable没关,把portmap的端口给阻挡了,检查防火墙状态:

service iptables status

果然如此,立即禁用,service iptables  stop,然后在mount,一切OK!

`clnt_create: RPC: Port mapper failure - Unable to send: errno 101 (Network is unreachable)` 错误通常表示客户端无法与 NFS 服务器建立网络连接。以下是一些可能的解决方法: #### 检查网络连接 - 确认客户端和服务器是否在同一网络中,并且网络连接正常。可以使用 `ping` 命令测试客户端与服务器之间的连通性,例如: ```bash ping 192.168.93.138 # 替换为实际的服务器 IP 地址 ``` #### 检查防火墙设置 - 服务器端的防火墙可能会阻止 NFS 相关的端口。NFS 服务依赖于多个服务,如 `portmap`、`nfsd`、`mountd` 等,需要在防火墙中放行这些服务。对于使用 `firewalld` 的系统,可以执行以下命令: ```bash firewall-cmd --add-service=nfs --permanent firewall-cmd --add-service=rpc-bind --permanent firewall-cmd --add-service=mountd --permanent firewall-cmd --reload ``` 如果使用的是 `iptables`,需要确保相关端口开放。NFS 使用的端口较多,通常可以通过关闭防火墙来测试是否是防火墙的问题,但这不是一个安全的长期解决方案: ```bash systemctl stop iptables ``` #### 检查 NFS 服务状态 - 确保服务器端的 NFS 服务和相关依赖服务(如 `rpcbind`)已经启动: ```bash systemctl status nfs-server systemctl status rpcbind ``` 如果服务未启动,可以使用以下命令启动: ```bash systemctl start nfs-server systemctl start rpcbind ``` 并且可以设置服务开机自启: ```bash systemctl enable nfs-server systemctl enable rpcbind ``` #### 检查 IP 地址和主机名配置 - 确保客户端配置的服务器 IP 地址或主机名正确,并且服务器的主机名解析正常。可以通过编辑 `/etc/hosts` 文件来手动配置主机名和 IP 地址的映射。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值