linux nfs建立共享目录,linux下nfs磁盘共享目录
linux多個服務(wù)器做nfs磁盤共享
要求要對三個服務(wù)器的 /usr/local/sources 目錄做一個共享,三個服務(wù)器信息如下
服務(wù)器01:6.199
服務(wù)器02:169.35
服務(wù)器03:3.162
三個服務(wù)器都是centos7.x的系統(tǒng),要把服務(wù)器01作為服務(wù)端,服務(wù)器02、03作為客戶端。那么開始部署操作。
服務(wù)器01:
1、在服務(wù)端的機器上安裝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 這個目錄已經(jīng)存在就不用重新創(chuàng)建
# vim /etc/exports
4、啟動nfs和rpcbind并設(shè)置為開機自啟
啟動nfs和rpcbind
# systemctl start nfs
# systemctl start rpcbind
設(shè)置nfs及rpcbind開機自啟
# systemctl enable nfs
# systemctl enable rpcbind
5、查看nfs及rpcbind啟動狀態(tài)
# systemctl status nfs
# systemctl status rpcbind
6、查看是否共享成功
# showmount -e localhost
服務(wù)器02、03:
1、在客戶端安裝nfs
# yum -y install nfs*
2、啟動nfs和rpcbind并設(shè)置開機自啟
# systemctl start nfs
# systemctl start rpcbind
# systemctl enable nfs
# systemctl enable rpcbind
3、測試共享是否成功
# 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磁盘共享目录的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux kernel 进程管理,Li
- 下一篇: linux系统是否支持gpt分区,Lin