這里寫自定義目錄標題
- 操作前提
- 安裝nfs
- 客戶端
操作前提
兩臺虛擬機,并且網路互通


安裝nfs
yum -y install nfs-utils rpcbind
啟動nfs service
systemctl start rpcbind
systemctl start nfs-server
systemctl start nfs-lock
systemctl start nfs-idmap

創建需要共享的目錄
mkdir -p /application/share #-p級聯創建
chmod -R 777 /application/share #權限修改
配置需要共享的目錄到/etc/exports下
echo "/application/share 1.1.1.3/24(rw,sync,no_root_squash)">>/etc/exports
exportfs -a #使exports的修改生效
showmount -e #查看是否設定成功

iptables -F #清空防火墻規則
客戶端
安裝nfs
yum -y install nfs-utils
檢查共享目錄是否設定正確
showmount -e 1.1.1.4 #ip地址為服務器地址

掛載遠程服務器NFS磁區到本地掛載點
mkdir -p /application/test
mount -t nfs 1.1.1.4:/application/share /application/test
df -h #查看掛載資訊



已經安裝nfs服務的虛擬機地址:
鏈接: https://pan.baidu.com/s/1sKx-dbNACBAtpzYQKr2O9g 提取碼: 9sn2 復制這段內容后打開百度網盤手機App,操作更方便哦

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/278566.html
標籤:其他
上一篇:Qt開發經驗小技巧121-130
