CentOS下部署NFS檔案系統

來源:互聯網
上載者:User

標籤:centos部署nfs

NFS是Network File System的簡寫,即網路檔案系統。一種使用於分散式檔案系統的協定。通過網路可以讓不同的機器、不同的作業系統能夠批次分享資料,讓應用程式在用戶端通過網路訪問位於伺服器的資料,是在類Unix系統間實現磁碟檔案分享權限設定的一種方法。


NFS 是獨立於作業系統,容許不同硬體及作業系統的系統共同進行檔案的分享。通過使用NFS,使用者和程式可以像訪問本地檔案一樣訪問遠端系統上的檔案。



查看CentOS是否已安裝NFS:

# rpm -qa | grep nfs# rpm -qa | grep rpcbind

什麼也沒顯示出來,說明還沒有安裝NFS


掛載光碟片

# mount /dev/cdrom /mnt/cdrommount: /dev/sr0 is write-protected, mounting read-only

進入安裝包,查看nfs的安裝包

# cd /mnt/cdrom/Packages/# ls *nfs*libnfsidmap-0.25-9.el7.x86_64.rpmnfs4-acl-tools-0.3.3-13.el7.x86_64.rpmnfsometer-1.7-0.el7.noarch.rpmnfstest-1.0.2-2.el7.noarch.rpmnfs-utils-1.3.0-0.el7.x86_64.rpmsblim-cmpi-nfsv3-1.1.1-9.el7.x86_64.rpmsblim-cmpi-nfsv4-1.1.0-10.el7.x86_64.rpmtexlive-mfnfss-svn19410.0-32.el7.noarch.rpmtexlive-psnfss-svn23394.9.2a-32.el7.noarch.rpm


安裝nfs,在安裝的過程中會有一些依賴包,如果你用yum安裝的時候,就可以不用結局依賴的關係了。

# rpm -ivh nfs-utils-1.3.0-0.el7.x86_64.rpm keyutils-1.5.8-3.el7.x86_64.rpm libevent-2.0.21-4.el7.x86_64.rpm libnfsidmap-0.25-9.el7.x86_64.rpm libtirpc-0.2.4-0.3.el7.x86_64.rpm rpcbind-0.2.0-23.el7.x86_64.rpmwarning: nfs-utils-1.3.0-0.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEYPreparing...                          ################################# [100%]Updating / installing...   1:libtirpc-0.2.4-0.3.el7           ################################# [ 17%]   2:rpcbind-0.2.0-23.el7             ################################# [ 33%]   3:libnfsidmap-0.25-9.el7           ################################# [ 50%]   4:libevent-2.0.21-4.el7            ################################# [ 67%]   5:keyutils-1.5.8-3.el7             ################################# [ 83%]   6:nfs-utils-1:1.3.0-0.el7          ################################# [100%]

啟動nfs服務

# service rpcbind startRedirecting to /bin/systemctl start  rpcbind.service[[email protected] Packages]# service nfs startRedirecting to /bin/systemctl start  nfs.service

再次查看nfs是否安裝,發現已經安裝

# rpm -qa | grep rpcbindrpcbind-0.2.0-23.el7.x86_64# rpm -qa | grep nfsnfs-utils-1.3.0-0.el7.x86_64libnfsidmap-0.25-9.el7.x86_64

編輯nfs的設定檔,設定要共用的目錄為/home/iso/

# vi /etc/exports/home/iso *(rw,sync,no_root_squash)


# exportfs -a

顯示掛載的共用光碟片:

# showmount -e localhostExport list for localhost:/home/iso *


本文出自 “李雲娜----IT女將” 部落格,請務必保留此出處http://liyunna.blog.51cto.com/9151125/1558339

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.