NFS服务端安装配置

所需环境: 两台机器,一台做服务端(192.168.133.130),一台做客户端(192.168.133.132)。
192.168.133.130 作为服务端安装

两台机器上,都需要装yum install -y nfs-utils

服务端操作:
yum install -y nfs-utils rpcbind

vim /etc/exports //加入如下内容
/home/nfstestdir 192.168.133.0/24(rw,sync,all_squash,anonuid=1000,anongid=1000) #保存配置文件后,执行如下准备操作 将/home/nfstestdir分享给192.168.133.0这个ip段的机器.
NFS服务端安装配置

mkdir /home/nfstestdir #创建分享的目录

chmod 777 /home/nfstestdir #增加权限

systemctl start rpcbind #启动rpcbind服务,因为nfs是用rpcbind进行通信的,端口为111.

systemctl start nfs #启动nfs服务
##服务端
systemctl enable rpcbind #设置开机自启
##服务端
systemctl enable nfs #设置开机自启

猜你喜欢

转载自blog.51cto.com/13451715/2328148