安裝nfs的配件前端
yum -y install nfs-utils rpcbind
複製代碼
編寫配置文件安全
vi /etc/exports
/opt/test/ *(rw,no_root_squash,no_all_squash,sync,anonuid=506,anongid=506)
exportfs -r
複製代碼
配置文件說明bash
啓動服務網絡
systemctl start rpcbind
systemctl start nfs
chkconfig rpcbind on
chkconfig nfs on
複製代碼
安裝async
yum -y install nfs-utils
複製代碼
mount掛載使用:tcp
mount -t nfs 10.10.90.1:/opt/test /mnt -o nolock
複製代碼
若是掛載出錯能夠使用以下方式:測試
mount -t nfs 10.10.90.1:/opt/test /mnt -o proto=tcp -o nolock
複製代碼
在NFS客戶端上執行如下命令,將本機的IP地址信息輸出到NFS目錄下的test.txt文件中:ui
ip addr > /mnt/test.txt
複製代碼
在服務端中能夠看到/opt/test/text.txt文件已經被建立。spa
umount /mnt
複製代碼