RPC: Port mapper failure - Unable to receive: errno 113 (No route to host)
Solution 1
I was testing this issue on CentOS 7. When you encounter such a problem you have to dig deeply.
The problem:
clnt_create: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host)
is related to firewall. The command showmount -e IP_server
shows all mounts that are available on server. This command works fine, but you have to be careful which port to open. It does not get through the firewall if only port 2049
has been opened. If the firewall on the NFS server has been configured to let NFS traffic get in, it will still block the showmount
command. To test if you disable firewall on server you should get rid of this issue.
So those ports should be open on server:
firewall-cmd --permanent --add-service=rpc-bind
firewall-cmd --permanent --add-service=mountd
firewall-cmd --permanent --add-port=2049/tcp
firewall-cmd --permanent --add-port=2049/udp
firewall-cmd --reload
Additional test 2049/NFS port for availability.
semanage port -l | grep 2049
- returns SELinux context and the service namenetstat -tulpen | grep 2049
Solution 2
instead of enabling port 2049 and then set semanage
, you can simply add nfs
service
firewall-cmd --add-service=nfs --permanent &&
firewall-cmd --reload
Related videos on Youtube
Bhavya Jain
Updated on September 18, 2022Comments
-
Bhavya Jain over 1 year
I am trying to mount hdfs on my local machine(ubuntu) using nfs by following the below link:--
https://www.cloudera.com/documentation/enterprise/5-2-x/topics/cdh_ig_nfsv3_gateway_configure.html#xd_583c10bfdbd326ba--6eed2fb8-14349d04bee--7ef4
So,at my machine I installed nfs-common using:-
sudo apt-get install nfs-common
Then,before mounting I have ran these commands:-
rpcinfo -p 192.168.170.52 program vers proto port service 100000 4 tcp 111 portmapper 100000 3 tcp 111 portmapper 100000 2 tcp 111 portmapper 100000 4 udp 111 portmapper 100000 3 udp 111 portmapper 100000 2 udp 111 portmapper 100024 1 udp 48435 status 100024 1 tcp 54261 status 100005 1 udp 4242 mountd 100005 2 udp 4242 mountd 100005 3 udp 4242 mountd 100005 1 tcp 4242 mountd 100005 2 tcp 4242 mountd 100005 3 tcp 4242 mountd 100003 3 tcp 2049 nfs showmount -e 192.168.170.52 Export list for 192.168.170.52: / *
after that i tried mounting the hdfs using:--
sudo mount -t nfs -o vers=3,proto=tcp,nolock 192.168.170.52:/ /mnt/hdfs_mount/
But i was getting this error:---
mount.nfs: mount system call failed
Then i googled for the problem and installed nfs-kernel-server,portmap using
sudo apt-get install nfs-kernel-server portmap
After executing the above command,the output for:---
rpcinfo -p 192.168.170.52
is:--
192.168.170.52: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host)
and for
showmount -e 192.168.170.52
is:---
clnt_create: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host)
Also the output for:--
sudo service nfs start
comes out to be:--
Failed to start nfs.service: Unit nfs.service not found.
Please help me with this.
-
Bhavya Jain almost 7 years@ridgy on the client
-
ridgy almost 7 yearsThe client only needs
nfs-common
installed.portmapper
andnfs-kernel-server
has to be installed on the server, but that already has been done. Maybe it is not OK to export the root filesystem (I never tried that, because it is unusual). Try exporting any other directory to see if it works then. -
Bhavya Jain almost 7 yearsThe output for "rpcinfo -p 192.168.170.52" and "showmount -e 192.168.170.52" should be same on the client as it was before installing "nfs-kernel-server and portmap" because I have not modified anything on server side.
-
-
Bhavya Jain almost 7 yearsI am unable to verify your solution as I have now opted for a completly different method.But I appreciate your effort.Thanks
-
benathon about 6 yearsthis method worked for me on suse linux. thanks!
-
AllisonC about 6 yearsCan confirm, this works for me on Redhat.
-
bgStack15 almost 5 yearsThank you! Mounting the export on a client worked, but showmount -e did not, before applying these steps.