服務器端
安裝nfs
yum install -y nfs-utils
創建共享目錄
mkdir /mnt/share
chown -R nfsnobody.nfsnobody # 修改權限
編輯nfs文件
vim etc/exports
寫入
共享目錄 可訪問的權限
/mnt/share *(rw)
啓動服務
啓動rpc服務
systemctl restart rpcbind
啓動nfs服務
systemctl restart nfs-server
showmount -e localhost #展示本地可掛載信息
查看狀態:
systemctl status -l nfs-server
查看rpcbind 和nfs端口狀態
netstat -lantu|grep 111
netstat -lantu|grep 2049
選擇共享權限:
shoumount -t ip
客戶端:
安裝nfs
yum -y install nfs-utils
查看鏈接狀態:
showmount -e 192.168.159.128
選擇文件夾及存儲到本地的位置
mount -t nfs 服務器端ip:/mnt/share /mnt/nfs