linux nfs建立共享目录,linux下nfs磁盘共享目录
linux多個(gè)服務(wù)器做nfs磁盤共享
要求要對(duì)三個(gè)服務(wù)器的 /usr/local/sources 目錄做一個(gè)共享,三個(gè)服務(wù)器信息如下
服務(wù)器01:6.199
服務(wù)器02:169.35
服務(wù)器03:3.162
三個(gè)服務(wù)器都是centos7.x的系統(tǒng),要把服務(wù)器01作為服務(wù)端,服務(wù)器02、03作為客戶端。那么開始部署操作。
服務(wù)器01:
1、在服務(wù)端的機(jī)器上安裝nfs和rpcbind程序
# yum -y install nfs*
# yum -y install rpcbind*
2、在安裝完nfs以及rpcbind以后檢查是否安裝完成
# rpm -qa|grep nfs
# rpm -qa|grep rpcbind
安裝成功,接下來要做的設(shè)置所要共享的文件夾目錄
3、由于我要共享的是 /usr/local/sources 這個(gè)目錄已經(jīng)存在就不用重新創(chuàng)建
# vim /etc/exports
4、啟動(dòng)nfs和rpcbind并設(shè)置為開機(jī)自啟
啟動(dòng)nfs和rpcbind
# systemctl start nfs
# systemctl start rpcbind
設(shè)置nfs及rpcbind開機(jī)自啟
# systemctl enable nfs
# systemctl enable rpcbind
5、查看nfs及rpcbind啟動(dòng)狀態(tài)
# systemctl status nfs
# systemctl status rpcbind
6、查看是否共享成功
# showmount -e localhost
服務(wù)器02、03:
1、在客戶端安裝nfs
# yum -y install nfs*
2、啟動(dòng)nfs和rpcbind并設(shè)置開機(jī)自啟
# systemctl start nfs
# systemctl start rpcbind
# systemctl enable nfs
# systemctl enable rpcbind
3、測(cè)試共享是否成功
# showmount -e 6.199
4、掛載(在服務(wù)端掛載)
# mount -t nfs -o nolock 6.199:/usr/local/sources /usr/loacl/sources
5、檢查是否成功
# df -h
另
如果要取消掛載 # umount 6.196:/usr/local/sources
總結(jié)
以上是生活随笔為你收集整理的linux nfs建立共享目录,linux下nfs磁盘共享目录的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux kernel 进程管理,Li
- 下一篇: linux系统是否支持gpt分区,Lin