一、yum 安装
yum -y install nfs-utils rpcbind
nfs 的配置文件 /etc/expots
默认为空
vi /etc/exports
/要挂载的目录 你的ip地址/24(rw,no_root_squash,no_all_squash,sync,anonuid=501,anongid=501)
二、使配置生效
exportfs -r
三、启动 nfs
service rpcbind start
service nfs start
chkconfig rpcbind on
chkconfig nfs on
四、客户端挂载:
#查看可挂载
showmount -e (其他主机填对应ip)
客户端挂载
mount -t nfs -o nolock -o tcp xx.xx.xx.xx:/your-nfs-path /mnt
无提示 既为成功
注意:客户端挂载的时候可能由于防火墙的原因挂载不成功,一种解决方法,关闭防火墙:
systemctl stop iptables.service