NFS共用儲存

來源:互聯網
上載者:User

標籤:共用資源   軟體包   客戶機   開發   網路   

NFS共用儲存

NFS是一種基於TCP/IP傳輸的網路檔案系統協議,有SUN公司開發,通過使用NFS協議,客戶機可以像訪問本地目錄一樣訪問遠程主機中的資源。在負載平衡群集中,使用NFS是比較常見的做法,NFS也是NAS存放裝置必然支援的一種協議。

3.1 使用NFS發布共用資源

NFS服務的實現依賴於RPC(Remote Process Call)機制,已完成遠程到本地的映射過程。需要安裝nfs-utils、rpcbind軟體包來提供nfs服務,前者用於NFS共用發布和訪問,後者用於PRC支援。

(1)安裝nfs-tuils、rpcbind

手動載入NFS共用服務時,應該先啟動rpcbind、然後再啟動NFS服務。

650) this.width=650;" style="border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://s3.51cto.com/wyfs02/M02/7F/74/wKiom1cfEcSw-uU9AAAlU_tN_mQ713.jpg" "554" height="50" />

啟動服務:

650) this.width=650;" style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://s3.51cto.com/wyfs02/M01/7F/74/wKiom1cfEfTBTMNvAAA_RqfiQnE260.jpg" "554" height="117" />

設定開機自啟:

650) this.width=650;" style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image006" border="0" alt="clip_image006" src="http://s3.51cto.com/wyfs02/M00/7F/74/wKiom1cfEgCwIq3pAABVvz5uISo401.jpg" "554" height="98" />

(2)設定共用目錄

NFS的設定檔為/etc/exports,檔案內容預設為空白,也就是無任何共用內容。共用格式:“目錄位置 客戶機地址(許可權控制)”

650) this.width=650;" style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image008" border="0" alt="clip_image008" src="http://s3.51cto.com/wyfs02/M01/7F/74/wKiom1cfEgSxfS_BAAAo-AFMMgg007.jpg" "554" height="50" />

(3)重新啟動服務

650) this.width=650;" style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image010" border="0" alt="clip_image010" src="http://s3.51cto.com/wyfs02/M02/7F/74/wKiom1cfEg6hZtQUAAB9pgAQwUE597.jpg" "554" height="261" />

(4)查看本機NFS共用目錄

650) this.width=650;" style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image012" border="0" alt="clip_image012" src="http://s3.51cto.com/wyfs02/M02/7F/72/wKioL1cfEtyQE_UDAAAnzT2caEY927.jpg" "553" height="53" />

(5)防火牆問題,因為nfs協議較為特殊,連接埠動態,不方便添加防火牆規則,解決方案如下:

650) this.width=650;" style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image014" border="0" alt="clip_image014" src="http://s3.51cto.com/wyfs02/M00/7F/74/wKiom1cfEhfyMhDNAAAjCqM-8qM914.jpg" "553" height="59" />

設定防火牆規則:

650) this.width=650;" style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image016" border="0" alt="clip_image016" src="http://s3.51cto.com/wyfs02/M00/7F/72/wKioL1cfEuyh1y5-AAByGclPuj0183.jpg" "554" height="113" />

並使用“service iptables save”儲存規則

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.