環境要求:centos7系統 1g 1核心的配置,沒有上限,請根據自己機器本身情況而定。
共兩台伺服器:
192.168.80.130(主)
192.168.80.131(從)
第一步:先關閉防火牆
systemctl stop firewalld
setenforce 0
第二步:安裝nfs和rpcbind
yum -y install nfs-utils rpcbind
第三步:建立共享的檔案
mkdir -p /data/web
授權:
chmod -r 777 /data/web/
啟動:
(!!!注意,一定先啟動rpcbind不然容易報錯!!!)
systemctl start rpcbind
systemctl start nfs
修改配置檔案:
vim /etc/exports
/data/web 192.168.80.0/24(rw,sync)
再重啟一下rpcbind和nfs
systemctl restart rpcbind
systemctl restart nfs
檢視一下自己共享服務:
[root@localhost ~]
# showmount -e
export list for localhost.localdomain:
/data/web 192.168.80.0/24
和主一樣,先安裝
yum -y install nfs-utils rpcbind
啟動:
systemctl start rpcbind
systemctl start nfs
顯示nfs伺服器共享目錄列表:
[root@localhost ~]
# showmount -e 192.168.80.130(主的ip)
export list for 192.168.80.130:
/data/web 192.168.80.0/24
掛載服務端的共享目錄:
mount -t nfs 192.168.80.130:/data/web /mnt
NFS共享服務(簡單了解)
nfs network file system 網路檔案系統 依賴於rpc 遠端過程呼叫 需安裝nfs utils rpcbind軟體包 系統服務 nfs rpcbind 共享配置檔案 etc exports 安裝nfs utils rpcbind軟體包 root localhost yum y i...
NFS 檔案共享
檔案共享 主機伺服器 主伺服器 ip 103.2.3.111 1 安裝nfs 和 rpcbind 安裝nfs utils rpcbind yum y install nfs utils rpcbind 檢視是否安裝 rpm qa grep nfs rpm qa grep rpcbind 2 關閉防火...
NFS共享儲存
yum install rpcbind rpc服務監聽111埠 yum install nfs utils nfs服務包 1 修改配置檔案 etc exports vim etc exports 修改配置檔案 data 192.168.10.0 24 rw,sync,no root squash 以...