安裝 NFS 服務器所需的軟件包
服務器 10.44.154.200
安裝nfs:yum -y install nfs-utils rpcbind
編輯exports文件
編輯/etc/exports,增加一行
/mnt/files/stone 10.170.184.39(rw,no_root_squash,no_all_squash,sync)
生效 exportfs -r
如圖xian'shi沒問題
查看 exportfs
為rpcbind和nfs做開機啟動
systemctl enable rpcbind.service
systemctl enable nfs-server.service
手動啟動
命令:service rpcbind start
service nfs start
查看已共享的目錄,命令:
本機:showmount -e
其他:showmount -e IP

安裝NFS 客戶端
客戶端機器 10.170.184.39
systemctl enable rpcbind.service
systemctl start rpcbind.service
掛載遠程目錄
mount -t nfs -o nolock,nfsvers=3,vers=3 -o proto=tcp 10.44.154.200:/mnt/files/stone /home/mnt/files/stone
查看結果
設置開機掛載,編輯/etc/fstab
vi /etc/fstab
加上
10.44.154.200:/mnt/files/stone /home/mnt/files/stone:/ /data nfs4 ro,hard,intr,proto=tcp,port=2049,noauto 0 0