如何搭建nfs伺服器?

NFS服務端的主要配置檔案是/etc/exports,預設不存在需要手動建立。

工具/原料

NFS

centos

方法/步驟

nfs依賴於RPC服務,所以在安裝nfs前必須先安裝RPC服務,安裝命令如下

yum install rpcbind

如何搭建nfs伺服器

再安裝nfs服務

yum install nfs-utils

如何搭建nfs伺服器

建立共享目錄

mkdir /nfsfiles

建立測試檔案

echo “this is my first nfs server” > /nfsfiles/README

vim /etc/exports

/nfsfiles 192.168.150.*(rw,sync,root_squash)

如何搭建nfs伺服器

啟動服務

如何搭建nfs伺服器

客戶端進行掛載

將共享檔案掛載到已經建立好了的資料夾/nfsfiles中

mount -t nfs 192.168.150.181:/nfsfiles/ /nfsfiles/

如何搭建nfs伺服器

進行驗證,出現以下結果表示掛載成功

如何搭建nfs伺服器

注意事項

必須關閉防火牆

伺服器, 配置檔案,
相關問題答案