Setting up the HDFS NFS Gateway

The NFS Gateway supports NFSv3 and allows HDFS to be mounted as part of the client’s local file system

Set up NFS Gateway to access HDFS data

Install hdfs nfs packages

 

#yum install hadoop-hdfs-nfs3.x86_64

#yum install hadoop-hdfs-portmap

To start the portmap and NFS gateway daemon:

Run either:

$ sudo service hadoop-hdfs-portmap start

$ sudo service hadoop-hdfs-nfs3 start

 

or

 

$ sudo /etc/init.d/hadoop-hdfs-portmap start

$ sudo /etc/init.d/hadoop-hdfs-nfs3 start

 

Verify validity of NFS related services

[root@phdmst04 ~]# rpcinfo -p phdmst04

program vers proto   port service

100005   1   tcp   4242 mountd

100000   2   udp   111 portmapper

100005    3   tcp   4242 mountd

100005   2   udp   4242 mountd

100003   3   tcp   2049 nfs

100000   2   tcp   111 portmapper

100005   3   udp   4242 mountd

100005   1   udp   4242 mountd

100005   2   tcp   4242 mountd

 

[root@phdmst04 ~]# showmount -e phdmst04

Export list for phdmst04:

/ 192.168.129.55/255.255.255.0

#mount -t nfs -o vers=3,proto=tcp,nolock,noatime phdmst04:/ /data/hdfs_mnt

[root@phdmst04 ~]# df -h

Filesystem           Size Used Avail Use% Mounted on

/dev/mapper/vg_cmri-lv_root

202G   11G 182G   6% /

tmpfs                  95G     0   95G   0% /dev/shm

/dev/sda1             485M   66M 394M 15% /boot

/dev/mapper/vg_cmri-lv_home

9.9G 2.1G 7.3G 23% /home

/dev/mapper/vg_data-lv_data

493G 243M 467G   1% /data

phdmst04:/     323T 3.3T 320T   2% /data/hdfs_mnt

Troubleshooting

check nfs3 and portmap status

[root@blpphdmst04 init.d]# ./hadoop-hdfs-portmap status
portmap is stopped
[root@blpphdmst04 init.d]# ./hadoop-hdfs-portmap start
starting portmap, logging to /var/log/gphd/hadoop-hdfs/hadoop-hdfs-portmap-blpphdmst04.mydev.com.out
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

[  OK  ]

[root@blpphdmst04 init.d]# ./hadoop-hdfs-nfs3 status
nfs3 is stopped

[root@blpphdmst04 init.d]# ./hadoop-hdfs-nfs3 start
starting nfs3, logging to /var/log/gphd/hadoop-hdfs/hadoop-hdfs-nfs3-blpphdmst04.mydev.com.out
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.

[  OK  ]
[root@blpphdmst04 init.d]# mount -t nfs -o vers=3,proto=tcp,nolock,noatime blpphdmst04:/ /data/hdfs_mnt
[root@blpphdmst04 init.d]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_cmri-lv_root
202G   16G  176G   9% /
tmpfs                  95G     0   95G   0% /dev/shm
/dev/sda1             477M   89M  363M  20% /boot
/dev/mapper/vg_cmri-lv_home
9.8G  2.0G  7.3G  22% /home
/dev/mapper/vg_data-lv_data
493G  117M  467G   1% /data
blpphdmst04:/      269T  2.9T  266T   2% /data/hdfs_mnt

 

Leave a comment