- 在挂载服务器中执行。
编辑/etc/exports文件
加入/mnt 10.101.1.122(rw,sync,no_root_squash)表示要挂载的目录。
exportfs -rv (全部重新export一次!)
如果存在防火墙挂载失败,可以试以下命令
firewall-cmd –permanent –add-rich-rule=”rule family=ipv4 source address=’10.101.1.122’ port port=’111’ protocol=’tcp’ accept”;
firewall-cmd –permanent –add-rich-rule=”rule family=ipv4 source address=’10.101.1.122’ port port=’2049’ protocol=’tcp’ accept”;
firewall-cmd –permanent –add-rich-rule=”rule family=ipv4 source address=’10.101.1.122’ port port=’111’ protocol=’udp’ accept”;
firewall-cmd –permanent –add-rich-rule=”rule family=ipv4 source address=’10.101.1.122’ port port=’4046’ protocol=’udp’ accept”;
在客户端中执行
mount -o nolock,nfsvers=3,vers=3 -t nfs 10.101.1.121:/mnt /data/mnt卸载
umount /mnt
相关链接:
http://www.cnblogs.com/mchina/archive/2013/01/03/2840040.html
http://blog.youkuaiyun.com/kevinhg/article/details/5967432/