1、下载rpcbind、nfs-utils相关依赖
yum install -y nfs-utils rpcbind
2、停止相关进程
systemctl stop rpcbind.socket
systemctl stop rpcbind
systemctl stop nfs
3、启动hadoop自带的portmap
nohup hadoop portmap 2>&1 >> /var/log/hadoop-nfs/portmap_running.log &
4、加入到开机自启
if [ ! -d /var/log/hadoop-nfs/ ];then
(mkdir /var/log/hadoop-nfs/)
else
(nohup hadoop portmap 2>&1 >> /var/log/hadoop-nfs/portmap_running.log &)
fi
5、添加NFS Gateway实例
6、启动NFS Gateway实例
二、验证
1、执行以下命令验证是否服务已经开启
rpcinfo -p ip
2、查看机器可被挂载的nfs目录
showmount -e ip
3、挂载
mount -t nfs -o vers=3,proto=tcp,nolock ip:/ $mount_point
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!