CentOS下NFS服務(wù)器配置實(shí)例_第1頁(yè)
CentOS下NFS服務(wù)器配置實(shí)例_第2頁(yè)
CentOS下NFS服務(wù)器配置實(shí)例_第3頁(yè)
CentOS下NFS服務(wù)器配置實(shí)例_第4頁(yè)
CentOS下NFS服務(wù)器配置實(shí)例_第5頁(yè)
已閱讀5頁(yè),還剩3頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

CentOS 下下 NFS 服務(wù)器配置實(shí)例服務(wù)器配置實(shí)例 2011 02 23 16 54 41 標(biāo)簽 CentOS NFS 服務(wù)器 原創(chuàng)作品 允許轉(zhuǎn)載 轉(zhuǎn)載時(shí)請(qǐng)務(wù)必以超鏈接形式標(biāo)明文章 原始出處 作者信息和本聲明 否則將追究 法律責(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 注 配置文件說(shuō)明 usr local data 為共享的目錄 使用絕對(duì)路徑 192 168 0 122 rw no root squash no all squash sync 為客戶端的地址及權(quán)限 地址可以 是一個(gè)網(wǎng)段 一個(gè) IP 地址或者是一個(gè)域名 域名支持通配符 如 地址與權(quán)限 中間沒(méi)有空格 權(quán)限說(shuō)明 rw read write 可讀寫(xiě) ro read only 只讀 sync 文件同時(shí)寫(xiě)入硬盤(pán)和內(nèi)存 async 文件暫存于內(nèi)存 而不是直接寫(xiě)入內(nèi)存 no root squash NFS 客戶端連接服務(wù)端時(shí)如果使用的是 root 的話 那么對(duì)服務(wù)端分享的目錄 來(lái)說(shuō) 也擁有 root 權(quán)限 顯然開(kāi)啟這項(xiàng)是不安全的 root squash NFS 客戶端連接服務(wù)端時(shí)如果使用的是 root 的話 那么對(duì)服務(wù)端分享的目錄來(lái) 說(shuō) 擁有匿名用戶權(quán)限 通常他將使用 nobody 或 nfsnobody 身份 all squash 不論 NFS 客戶端連接服務(wù)端時(shí)使用什么用戶 對(duì)服務(wù)端分享的目錄來(lái)說(shuō)都是擁有 匿名用戶權(quán)限 anonuid 匿名用戶的 UID 值 通常是 nobody 或 nfsnobody 可以在此處自行設(shè)定 anongid 匿名用戶的 GID 值 四 啟動(dòng)四 啟動(dòng) NFS 服務(wù)器并進(jìn)行測(cè)試 服務(wù)器并進(jìn)行測(cè)試 1 啟動(dòng) NFS 服務(wù)器 root youxia121 data service portmap start 啟動(dòng) portmap 確定 root youxia121 data service nfs start 啟動(dòng) NFS 服務(wù) 確定 關(guān)掉 NFS 配額 確定 啟動(dòng) NFS 守護(hù)進(jìn)程 確定 啟動(dòng) NFS mountd 確定 2 在客戶端進(jìn)行測(cè)試 創(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)建一個(gè)測(cè)試文件并進(jìn)行檢查 root youxia122 cd usr local data root youxia122 data echo this is a test usr local data hehehe root youxia122 data ll h 總計(jì) 8 0K rw r r 1 root root 15 02 23 16 47 hehehe 在服務(wù)器端檢查 root youxia121 usr ll h usr local data 總計(jì) 8 0K rw r r 1 root root 15 02 23 16 47 heheh 五 我在配置中遇到的問(wèn)題 五 我在配置中遇到的問(wèn)題 1 在啟動(dòng) NFS 服務(wù)器的時(shí)候遇到的一個(gè)問(wèn)題如下 原因在于 NFS 配置文件中地址與權(quán)限中間 多了一個(gè)空格 去掉空格重新啟動(dòng)即可 root youxia121 local service nfs restart 關(guān)閉 NFS mountd 確定 關(guān)閉 NFS 守護(hù)進(jìn)程 確定 關(guān)閉 NFS 服務(wù) 確定 啟動(dòng) 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 配額 確定 啟動(dòng) NFS 守護(hù)進(jìn)程 確定 啟動(dòng) NFS mountd 確定 2 客戶端在掛載的時(shí)候遇到的一個(gè)問(wèn)題如下 可能是網(wǎng)絡(luò)不太穩(wěn)定 NFS 默認(rèn)是用 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 的配置過(guò)程 設(shè)備 兩臺(tái) centos6 OS 安裝的時(shí)候選擇的是 Basic Server 軟件配置包 首先 讓兩臺(tái)機(jī)器都安裝 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 可以訪問(wèn) 訪問(wèn)權(quán)限是自讀 root 用戶 啟動(dòng)對(duì)應(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 查看是否能訪問(wèn) 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 配置開(kāi)機(jī)自動(dòng)掛載 root vmBS00 vi etc fstab

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論