




已閱讀5頁,還剩3頁未讀, 繼續(xù)免費閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
CentOS 下下 NFS 服務(wù)器配置實例服務(wù)器配置實例 2011 02 23 16 54 41 標簽 CentOS NFS 服務(wù)器 原創(chuàng)作品 允許轉(zhuǎn)載 轉(zhuǎn)載時請務(wù)必以超鏈接形式標明文章 原始出處 作者信息和本聲明 否則將追究 法律責(zé)任 一 應(yīng)用環(huán)境介紹 一 應(yīng)用環(huán)境介紹 用途操作系統(tǒng)IP 地址 服務(wù)器端CentOS 5 2 X86 64 192 168 0 121 客戶端CentOS 5 2 X86 64 192 168 0 122 二 二 NFS 相關(guān)軟件的安裝 相關(guān)軟件的安裝 root youxia122 yum y install portmap nfs 三 服務(wù)器端配置 三 服務(wù)器端配置 1 創(chuàng)建共享的目錄 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 為客戶端的地址及權(quán)限 地址可以 是一個網(wǎng)段 一個 IP 地址或者是一個域名 域名支持通配符 如 地址與權(quán)限 中間沒有空格 權(quán)限說明 rw read write 可讀寫 ro read only 只讀 sync 文件同時寫入硬盤和內(nèi)存 async 文件暫存于內(nèi)存 而不是直接寫入內(nèi)存 no root squash NFS 客戶端連接服務(wù)端時如果使用的是 root 的話 那么對服務(wù)端分享的目錄 來說 也擁有 root 權(quán)限 顯然開啟這項是不安全的 root squash NFS 客戶端連接服務(wù)端時如果使用的是 root 的話 那么對服務(wù)端分享的目錄來 說 擁有匿名用戶權(quán)限 通常他將使用 nobody 或 nfsnobody 身份 all squash 不論 NFS 客戶端連接服務(wù)端時使用什么用戶 對服務(wù)端分享的目錄來說都是擁有 匿名用戶權(quán)限 anonuid 匿名用戶的 UID 值 通常是 nobody 或 nfsnobody 可以在此處自行設(shè)定 anongid 匿名用戶的 GID 值 四 啟動四 啟動 NFS 服務(wù)器并進行測試 服務(wù)器并進行測試 1 啟動 NFS 服務(wù)器 root youxia121 data service portmap start 啟動 portmap 確定 root youxia121 data service nfs start 啟動 NFS 服務(wù) 確定 關(guān)掉 NFS 配額 確定 啟動 NFS 守護進程 確定 啟動 NFS mountd 確定 2 在客戶端進行測試 創(chuàng)建需要掛載的目錄 root youxia122 local mkdir usr local data 執(zhí)行掛載命令 root youxia122 local mount t nfs 192 168 0 121 usr local data usr local data o proto tcp o nolock 在客戶端創(chuàng)建一個測試文件并進行檢查 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 在服務(wù)器端檢查 root youxia121 usr ll h usr local data 總計 8 0K rw r r 1 root root 15 02 23 16 47 heheh 五 我在配置中遇到的問題 五 我在配置中遇到的問題 1 在啟動 NFS 服務(wù)器的時候遇到的一個問題如下 原因在于 NFS 配置文件中地址與權(quán)限中間 多了一個空格 去掉空格重新啟動即可 root youxia121 local service nfs restart 關(guān)閉 NFS mountd 確定 關(guān)閉 NFS 守護進程 確定 關(guān)閉 NFS 服務(wù) 確定 啟動 NFS 服務(wù) 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 確定 關(guān)掉 NFS 配額 確定 啟動 NFS 守護進程 確定 啟動 NFS mountd 確定 2 客戶端在掛載的時候遇到的一個問題如下 可能是網(wǎng)絡(luò)不太穩(wěn)定 NFS 默認是用 UDP 協(xié)議 換成 TCP 協(xié)議即可 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 本節(jié)是使用 centos 6 的配置過程 設(shè)備 兩臺 centos6 OS 安裝的時候選擇的是 Basic Server 軟件配置包 首先 讓兩臺機器都安裝 NFS 的 軟件包 如下顯示的是服務(wù)器端 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 服務(wù)器端 建立掛載的目錄 并且掛載目錄 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 區(qū)間的 IP 可以訪問 訪問權(quán)限是自讀 root 用戶 啟動對應(yīng)的服務(wù) 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 服務(wù) 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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 岑溪市元旦親子活動方案
- 小班疫情區(qū)域活動方案
- 市民中心文體活動方案
- 居家單人活動方案
- 小孩冬至活動創(chuàng)意活動方案
- 局讀書活動方案
- 小衣服店開業(yè)活動方案
- 小學(xué)福文化宣傳活動方案
- 師生滿意提升活動方案
- 歲末營銷活動方案
- 全國二卷2025年高考數(shù)學(xué)真題含解析
- 2025年上海市中考語文試卷真題(含答案及解析)
- 2025年湖南省中考英語試卷真題(含答案)
- 樓梯 欄桿 欄板(一)22J403-1
- 國家開放大學(xué)??啤稒C械制圖》形考任務(wù)1-4試題及答案
- 北師大高考歷史強基考試題目
- 2024年河南省豫地科技集團有限公司招聘筆試參考題庫含答案解析
- 2024年山西焦煤西山煤電集團招聘筆試參考題庫含答案解析
- 《活板》綜合練習(xí)
- MD11使用說明書
- 最新國家開放大學(xué)電大《MySQL數(shù)據(jù)庫應(yīng)用》網(wǎng)絡(luò)核心課實驗訓(xùn)練2及4答案
評論
0/150
提交評論