安装NFS服务
yum -y install rpcbind nfs-utils创建共享目录并且设置相应的权限
编辑配置文件
vim /etc/exports/data/share/ 192.168.0.101(rw,no_root_squash,no_all_squash,sync)
/home/data/ 192.168.0.0/24(rw,no_root_squash,no_all_squash,sync) #允许局域网内所有的客户端访问
#NFS客户端挂载nfs服务器共享目录时的报错及解决办法:mount.nfs: access denied by server while mounting
/nfsfile 192.168.41.*(rw,sync,root_squash)更新配置
exportfs -r启动服务
1)按照顺序启动
systemctl start rpcbind
systemctl start nfs2)加入开机启动项
systemctl enable rpcbind
systemctl enable nfs关闭防火墙和关闭 SELINUX
systemctl disable firewalld
setenforce 0启动后查看NF服务是否正常
rpcinfo -p查看服务器(本机)是否可以连接
showmount -e localhostCentOS 7中搭建NFS文件共享存储服务
NFS客户端挂载nfs服务器共享目录时的报错及解决办法:mount.nfs: access denied by server while mounting
Centos7配置nfs