CentOS NFS 網(wǎng)絡(luò)共享磁盤 配置三步曲
參考:https://www.howtoforge.com/nfs-server-and-client-on-centos-7#-nfs-client-end
1.Server Side配置
2.Client Side 配置
安裝配置nfs, 在客戶機(jī)上的安裝
yum install ufs-utils
systemctl enable rpcbind
systemctl start rpcbind
mkdir /data/share
chmod -R 777 /data/share
mount -t nfs 192.168.0.100:/data/share /data/share
設(shè)置/etc/fstab, 自啟動(dòng)nfs
192.168.0.100:/data/share /data/share nfs defaults 0 0
systemctl restart rpcbind
3.測試
1.Server Side配置
yum install nfs-utils
安裝完成后,進(jìn)行配置
mkdir /data/share
chmod -R 777 /data/share
設(shè)置自啟動(dòng)
systemctl enable nfs-server ipcbind
systemctl start nfs-server ipcbind
配置
vim /etc/exports
添加以下內(nèi)容
/data/share 192.168.0.101(rw,sync,no_root_squash,no_all_squash)
其中192.168.0.101為要給哪個(gè)客戶端IP開放
systemctl restart nfs-server
配置防火墻(如何沒有添加防火墻就算了)
firewall-cmd --permanent --zone=public --add-service=nfs
firewall-cmd --reload
安裝完成后,進(jìn)行配置
mkdir /data/share
chmod -R 777 /data/share
設(shè)置自啟動(dòng)
systemctl enable nfs-server ipcbind
systemctl start nfs-server ipcbind
配置
vim /etc/exports
添加以下內(nèi)容
/data/share 192.168.0.101(rw,sync,no_root_squash,no_all_squash)
其中192.168.0.101為要給哪個(gè)客戶端IP開放
systemctl restart nfs-server
配置防火墻(如何沒有添加防火墻就算了)
firewall-cmd --permanent --zone=public --add-service=nfs
firewall-cmd --reload
2.Client Side 配置
安裝配置nfs, 在客戶機(jī)上的安裝
yum install ufs-utils
systemctl enable rpcbind
systemctl start rpcbind
mkdir /data/share
chmod -R 777 /data/share
mount -t nfs 192.168.0.100:/data/share /data/share
設(shè)置/etc/fstab, 自啟動(dòng)nfs
192.168.0.100:/data/share /data/share nfs defaults 0 0
systemctl restart rpcbind
3.測試
在192.168.1.100 nfs server中
cd /data/share
touch a.txt
cat aaaa> b.txt
進(jìn)入192.168.1.101 nfs client中
cd /data/share
查看文件列表 ls
因此所有的功能配置完成了,希望對朋友們有幫助。
cd /data/share
touch a.txt
cat aaaa> b.txt
進(jìn)入192.168.1.101 nfs client中
cd /data/share
查看文件列表 ls
因此所有的功能配置完成了,希望對朋友們有幫助。
posted on 2016-10-22 01:50 草原上的駱駝 閱讀(3186) 評論(0) 編輯 收藏 所屬分類: Linux