centos使用nfs共用伺服器

來源:互聯網
上載者:User

標籤:nfs   網路檔案分享權限設定   

一、簡介

   NFS(Network File System/網路檔案系統):

      1)、設定Linux系統之間的檔案分享權限設定(Linux與Windows中間檔案分享權限設定採用SAMBA服務);

2)、NFS只是一種檔案系統,本身沒有傳輸功能,是基於RPC協議實現的,才能達到兩個Linux系統之間的檔案目錄共用;

3)、NFS為C/S架構;


二、依賴的服務和軟體包

   1、檢查下列兩個包是否已經安裝(預設安裝完RHEL或者CentOS系統,就已經安裝了這兩個軟體包) 

     rpm -qa nfs-utils rpcbind

     或

     rpm -qa|grep "nfs-utils|rpcbind"[效率不如前者]

   2、如果沒有安裝,現在就安裝它們
     yum install nfs-utils rpcbind -y

三.啟動

     /etc/init.d/rpcbind start

     /etc/init.d/nfs start

     注:

     1./etc/init.d/nfs reload 相當於exports -r 

      rpcinfo -p localhost 可見rpc的資訊

      

四.配置

     vi /etc/exports

     /data 192.168.120.*(rw,sync) 

     cat /var/lib/nfs/etab

     anonuid=65534,anongid=65534

     nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin

     查看配置:

     showmount -e 127.0.0.1

五.運行

     mount -t nfs 192.168.120.143:/data /mnt

六.在其他用戶端上運行rpcbind

     mount -t nfs 192.168.120.143:/data /mnt

七.在用戶端和伺服器端

     vi /etc/rc.local

     >/etc/udev/rules.d/70-persistent-net.rules

     /etc/init.d/rpcbind start

     /etc/init.d/nfs start

     mount -t nfs 192.168.120.143:/data /mnt

     

      

      

   


centos使用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.