1、下载rpcbind、nfs-utils相关依赖

  1. yum install -y nfs-utils rpcbind

2、停止相关进程

  1. systemctl stop rpcbind.socket
  2. systemctl stop rpcbind
  3. systemctl stop nfs

3、启动hadoop自带的portmap

  1. nohup hadoop portmap 2>&1 >> /var/log/hadoop-nfs/portmap_running.log &

4、加入到开机自启

  1. if [ ! -d /var/log/hadoop-nfs/ ];then
  2. (mkdir /var/log/hadoop-nfs/)
  3. else
  4. (nohup hadoop portmap 2>&1 >> /var/log/hadoop-nfs/portmap_running.log &)
  5. fi

5、添加NFS Gateway实例
image.png
6、启动NFS Gateway实例
image.png

二、验证
1、执行以下命令验证是否服务已经开启

  1. rpcinfo -p ip

image.png
2、查看机器可被挂载的nfs目录

  1. showmount -e ip

image.png
3、挂载

  1. mount -t nfs -o vers=3,proto=tcp,nolock ip:/ $mount_point
  2. mount -t nfs -o vers=3,proto=tcp,nolock 10.168.1.28:/test_nfs/ /mnt/

参考文档:https://blog.csdn.net/rzliuwei/article/details/38388279

window挂载

先在本地启用nfs(百度上有)

然后执行
net use X: \ip!