1.檢查是否安裝nfs
yum list installed | grep nfs
2.安裝nfs(所有domc所在服務器都要安裝)
(1)yum -y install nfs-utils
(2)設置開機啓動
<所有服務器都要安裝---start--->
systemctl start nfs
systemctl enable nfs
(查看nfs狀態)
systemctl status nfs
<所有服務器都要安裝---end--->
<主服務器安裝即可---start--->
systemctl start rpcbind
systemctl enable rpcbind
(查看rpcbind狀態)
systemctl status rpcbind
<主服務器安裝即可---start--->
3.在主服務器上上共享domc/statics文件夾
(1)vi /etc/exports
/data/app/domc/statics 具體ip/24(rw,sync)
(2)依次重啓服務端rpcbind、nfs服務
systemctl restart rpcbind
systemctl restart nfs
4.啓動客戶端nfs服務,掛載服務端共享目錄
systemctl start nfs
mount -t nfs 主服務器ip:/data/app/domc/statics /data/app/domc/statics
備註:
取消掛載
umount 掛載路徑
更換共享路徑
修改/etc/exports,並重啓rpcbind,nfs