9

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
  • 333
  • 1
  • 5
  • 11
  • Where did you install `nfs-kernel-server portmapper`? On the client or on the server? As the first output of `rpcinfo -p 192.168.170.52` and `showmount -e 192.168.170.52` suggests, portmapper and nfs server were already running on the server. – ridgy Jun 28 '17 at 15:03
  • @ridgy on the client – Bhavya Jain Jun 29 '17 at 04:20
  • The client only needs `nfs-common` installed. `portmapper`and `nfs-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. – ridgy Jun 29 '17 at 21:49
  • The 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 Jul 03 '17 at 07:23

4 Answers4

25

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 name
  • netstat -tulpen | grep 2049
fra-san
  • 9,931
  • 2
  • 21
  • 42
Dragos Alexe
  • 366
  • 3
  • 5
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
Kevdog777
  • 3,194
  • 18
  • 43
  • 64
0

i also got the same error and later on i found the error , that the firewall of the server is blocking the nfs and then i stopped the firewall by systemclt stop firewalld (this is not recommended better edit firewall policy)

0

I was able to get this working with AlmaLinux 9.1 as a server and MacOS and other Almas as clients with the following - all based on parts of the other answers:

firewall-cmd --permanent --add-service=rpc-bind
firewall-cmd --permanent --add-service=mountd
firewall-cmd --permanent --add-service=nfs
firewall-cmd --reload