准备工作:
假设源端IP:10.10.70.72 共享目录 /temp/share
目标端IP:10.10.71.193 mount节点目录/temp/share
配置工作:
1.、源端:在源端服务器上的/etc/exports 文件中,加入
/temp/share 10.10.70.72/8(rw,no_root_squash)
保存并退出
2、重启nfs服务:/bin/systemctl restart nfs.service
3、开启portmap服务:/bin/systemctl restart portmap.service
4.、查看源端是否给出了共享目录:showmount -e
一切正常后,可以到目标端去配置
目标端不需要配置,只需执行mount命令即可
在mount之前,先得保证目标端的 portmap 服务开启
否则mount会很长一段时间,最后报mount.nfs: Input/output error
在mount之前可以先查看一下源端是否给出了共享目录 showmount -e 10.10.4.237
一切正常后可以执行mount命令了:
mount -t nfs 10.10.4.237:/temp/share /temp/share
mount -t nfs -o nolock,nfsvers=3,vers=3 10.10.4.237:/data/apache-tomcat/data/apache-tomcat-image-7070/webapps/ROOT/upload /data/apache-tomcat/data/apache-tomcat-platform-9090/webapps/ROOT/upload