




已閱讀5頁,還剩3頁未讀, 繼續免費閱讀
版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
CentOS 下下 NFS 服務器配置實例服務器配置實例 2011 02 23 16 54 41 標簽 CentOS NFS 服務器 原創作品 允許轉載 轉載時請務必以超鏈接形式標明文章 原始出處 作者信息和本聲明 否則將追究 法律責任 一 應用環境介紹 一 應用環境介紹 用途操作系統IP 地址 服務器端CentOS 5 2 X86 64 192 168 0 121 客戶端CentOS 5 2 X86 64 192 168 0 122 二 二 NFS 相關軟件的安裝 相關軟件的安裝 root youxia122 yum y install portmap nfs 三 服務器端配置 三 服務器端配置 1 創建共享的目錄 root youxia121 data mkidr usr local data 2 修改 NFS 配置文件 root youxia121 data vi etc exports usr local data 192 168 0 122 rw no root squash no all squash sync 注 配置文件說明 usr local data 為共享的目錄 使用絕對路徑 192 168 0 122 rw no root squash no all squash sync 為客戶端的地址及權限 地址可以 是一個網段 一個 IP 地址或者是一個域名 域名支持通配符 如 地址與權限 中間沒有空格 權限說明 rw read write 可讀寫 ro read only 只讀 sync 文件同時寫入硬盤和內存 async 文件暫存于內存 而不是直接寫入內存 no root squash NFS 客戶端連接服務端時如果使用的是 root 的話 那么對服務端分享的目錄 來說 也擁有 root 權限 顯然開啟這項是不安全的 root squash NFS 客戶端連接服務端時如果使用的是 root 的話 那么對服務端分享的目錄來 說 擁有匿名用戶權限 通常他將使用 nobody 或 nfsnobody 身份 all squash 不論 NFS 客戶端連接服務端時使用什么用戶 對服務端分享的目錄來說都是擁有 匿名用戶權限 anonuid 匿名用戶的 UID 值 通常是 nobody 或 nfsnobody 可以在此處自行設定 anongid 匿名用戶的 GID 值 四 啟動四 啟動 NFS 服務器并進行測試 服務器并進行測試 1 啟動 NFS 服務器 root youxia121 data service portmap start 啟動 portmap 確定 root youxia121 data service nfs start 啟動 NFS 服務 確定 關掉 NFS 配額 確定 啟動 NFS 守護進程 確定 啟動 NFS mountd 確定 2 在客戶端進行測試 創建需要掛載的目錄 root youxia122 local mkdir usr local data 執行掛載命令 root youxia122 local mount t nfs 192 168 0 121 usr local data usr local data o proto tcp o nolock 在客戶端創建一個測試文件并進行檢查 root youxia122 cd usr local data root youxia122 data echo this is a test usr local data hehehe root youxia122 data ll h 總計 8 0K rw r r 1 root root 15 02 23 16 47 hehehe 在服務器端檢查 root youxia121 usr ll h usr local data 總計 8 0K rw r r 1 root root 15 02 23 16 47 heheh 五 我在配置中遇到的問題 五 我在配置中遇到的問題 1 在啟動 NFS 服務器的時候遇到的一個問題如下 原因在于 NFS 配置文件中地址與權限中間 多了一個空格 去掉空格重新啟動即可 root youxia121 local service nfs restart 關閉 NFS mountd 確定 關閉 NFS 守護進程 確定 關閉 NFS 服務 確定 啟動 NFS 服務 exportfs No options for usr local data 192 168 0 122 suggest 192 168 0 122 sync to avoid warning exportfs No host name given with usr local data rw no root squash no all squash sync suggest rw no root squash no all squash sync to avoid warning 確定 關掉 NFS 配額 確定 啟動 NFS 守護進程 確定 啟動 NFS mountd 確定 2 客戶端在掛載的時候遇到的一個問題如下 可能是網絡不太穩定 NFS 默認是用 UDP 協議 換成 TCP 協議即可 root youxia122 local mount t nfs 192 168 0 121 usr local data usr local data mount nfs Input output error 解決方法 mount t nfs 192 168 0 121 usr local data usr local data o proto tcp o nolock NFS 的安裝配置 centos 5 yum install nfs utils portmap centos 6 yum install nfs utils rpcbind 本節是使用 centos 6 的配置過程 設備 兩臺 centos6 OS 安裝的時候選擇的是 Basic Server 軟件配置包 首先 讓兩臺機器都安裝 NFS 的 軟件包 如下顯示的是服務器端 root roothomes home yum install nfs utils rpcbind Loaded plugins fastestmirror Loading mirror speeds from cached hostfile base extras updates Setting up Install Process Package rpcbind 0 2 0 8 el6 x86 64 already installed and latest version Resolving Dependencies Running transaction check Package nfs utils x86 64 1 1 2 3 15 el6 set to be updated Finished Dependency Resolution Dependencies Resolved Package Arch Version Repository Size Updating nfs utils x86 64 1 1 2 3 15 el6 base 308 k Transaction Summary Install 0 Package s Upgrade 1 Package s Total download size 308 k Is this ok y N y Downloading Packages nfs utils 1 2 3 15 el6 x86 64 rpm 308 kB 00 10 warning rpmts HdrFromFdno Header V3 RSA SHA1 Signature key ID c105b9de NOKEY base gpgkey 3 3 kB 00 00 Importing GPG key 0 xC105B9DE CentOS 6 Key CentOS 6 Official Signing Key from etc pki rpm gpg RPM GPG KEY CentOS 6 Is this ok y N y Running rpm check debug Running Transaction Test Transaction Test Succeeded Running Transaction Updating 1 nfs utils 1 2 3 15 el6 x86 64 1 2 Cleanup 1 nfs utils 1 2 2 7 el6 x86 64 2 2 Updated nfs utils x86 64 1 1 2 3 15 el6 Complete root roothomes home 服務器端 建立掛載的目錄 并且掛載目錄 root roothomes etc mkdir opt centos6 root roothomes etc cd opt centos6 root roothomes opt centos6 mkdir thisISnfsFile root roothomes opt centos6 ls thisISnfsFile root roothomes etc vi etc exports root roothomes opt centos6 cat etc exports opt centos6 192 168 1 0 24 ro no root squash 備注 opt centos6 表示 nfs 共享的目錄 192 168 1 0 192 168 1 254 區間的 IP 可以訪問 訪問權限是自讀 root 用戶 啟動對應的服務 root roothomes opt centos6 chkconfig nfs on root roothomes opt centos6 etc init d rpcbind start root roothomes opt centos6 etc init d nfs start Starting NFS services OK Starting NFS quotas OK Starting NFS daemon OK Starting NFS mountd OK root roothomes opt centos6 service iptables stop iptables Flushing firewall rules OK iptables Setting chains to policy ACCEPT filter OK iptables Unloading modules 三 OK 客戶端 root roothomes home yum install nfs utils rpcbind 安裝完畢 root vmBS00 service iptables stop iptables Flushing firewall rules OK iptables Setting chains to policy ACCEPT filter OK iptables Unloading modules OK 查看是否能訪問 nfs 服務 root vmBS00 showmount e 192 168 1 75 Export list for 192 168 1 75 opt centos6 192 168 1 0 24 root vmBS00 mkdir opt centos6 root vmBS00 mount t nfs 192 168 1 75 opt centos6 opt centos6 root vmBS00 ls opt centos6 thisISnfsFile 配置開機自動掛載 root vmBS00 vi etc fstab
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 工程師資質及經驗證明書(5篇)
- 電子發票開具及報銷流程規定合同書
- 2025年音樂教育專業考試題及答案
- 2025年創新創業實踐與管理能力測試卷及答案
- 2025年甘肅省平涼華亭市策底鎮招聘專業化管理的村文書筆試備考試題及答案詳解1套
- 物資采購基本管理制度
- 特殊幼兒患病管理制度
- 特殊材料入庫管理制度
- 率土之濱團隊管理制度
- 玩具掛件庫存管理制度
- 工模外發管理流程模板
- 部編版高一上冊語文第三課《百合花》課文原文教案及知識點
- 北京理工附中小升初分班考試真題
- 膀胱鏡檢查記錄
- 英語社團活動課件
- 學前兒童發展心理學-情感
- 二年級下冊數學教案 《生活中的大數》練習課 北師大版
- GB∕T 16762-2020 一般用途鋼絲繩吊索特性和技術條件
- 電網施工作業票模板
- T∕CAEPI 31-2021 旋轉式沸石吸附濃縮裝置技術要求
- 國家級高技能人才培訓基地建設項目實施管理辦法
評論
0/150
提交評論