NFS 服務搭建

來源:互聯網
上載者:User

標籤:exports   硬碟   rest   防火牆設定   設定檔   伺服器端   相關   exp   pkg   

1、系統內容

查詢當前系統,安裝對應得版本得 nfs相關軟體;本文系統內容為 Ubuntu 16.04 amd64

# lsb_release -a

?

2、NFS 伺服器端2.1 軟體安裝2.1.1 deb安裝

直接 deb安裝

# dpkg -i *.deb

?

2.1.2 連網安裝
# apt-get install nfs-kernel-server

?

3.2 服務配置3.2.1 防火牆設定

若不需要 防火牆,可直接關閉防火牆

# ufw disable

?

3.2.2 NFS 配置3.2.2.1 設定檔

修改配置,重啟服務

# vim /etc/exports# /etc/init.d/nfs-kernel-server restart## 或者不需要重啟服務,讓配置生效(  exportfs -r),用戶端最好重新掛載

?

3.2.2.2 設定檔參數
/opt *(rw,async,fsid=0,no_root_squash,no_subtree_check)
參數 說明
/opt 共用目錄
rw 可擦寫 (read-write)
async 資料會先暫存於記憶體當中,而非直接寫入硬碟
no_root_squash 用戶端使用 NFS 檔案系統的帳號若為 root 時,系統該如何判斷這個帳號的身份?預設的情況下,用戶端 root 的身份會由 root_squash 的設定壓縮成 nfsnobody, 如此對伺服器的系統會較有保障開放用戶端使用 root 身份來動作伺服器的檔案系統
no_subtree_check 預設參數
備忘 詳細參見 "man exports"

?

3.2.3 服務基本操作

查看當前服務共用的目錄

# showmount -e
4、NFS 用戶端4.1 軟體安裝4.1.1 deb安裝

直接 deb安裝

# dpkg -i *.deb

?

4.1.2 連網安裝
# apt-get install nfs-common

?

4.2 NFS用戶端掛載
# mount -t nfs {nfs_server_ip}:{share_path} {mount_path}
參數 說明
nfs_server_ip NFS 伺服器IP
share_path NFS 伺服器共用目錄
moun_path NFS用戶端本地掛載目錄

?

4.3 NFS用戶端卸載
# umount {mount_path}

NFS 服務搭建

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.