文章目录
运维相关
一、Linux下部署NFS
1.简介:
NFS:网络文件系统,英文Network File System(NFS),是由SUN公司研制的UNIX表示层协议(pressentation layer protocol),能让使用者像访问自己的计算机一样访问网络上的文件。
2.部署步骤:
(1)准备两台服务器(以Centos7为例),一台为服务端(被共享),一台为客户端(访问被共享服务器)。
(2)服务端:yum -y install nfs-utils rpcbind
客户端:yum -y install nfs-utils
(3)在服务端上配置共享目录及访问权限:
[root@K share]# vim /etc/exports #添加如下配置
/home/share IP(rw,sync,root_squash) #IP:客户端的IP地址。
(4)重启NFS:
systemctl restart nfs #此时服务端已配置完共享
(5)客户端挂载:
查看服务端共享配置:
[root@K2 share2]# showmount -e ip #IP:服务端的IP地址
Export list for ip:
/home/share ip
挂载:
mount -t nfs 服务端IP:/home/share /home/share2/
备注:以上操作将服务端/home/share目录共享给客户端,并挂载到客户端的/home/share2 目录下。
(6)查看挂载情况:
[root@K share2]# df -h
*- - - - - - -
*- - - - - - -
服务端IP:/home/share 100G 66G 30G 70% /home/share2
#game over