安装nfs工具
yum install -y nfs-utils
配置共享目录
创建共享目录
mkdir /home/share
目录授权
chmod 766 /home/share
编辑exports
vi /etc/exports
添加内容
/home/share 192.168.1.0/24(rw,sync)
先启动rpcbind
systemctl start rpcbind
在启动nfs
systemctl start nfs
查看本机共享目录
exportfs
防火墙设置
firewall-cmd --permanent --add-service=nfs
firewall-cmd --reload
挂载共享目录
安装nfs,同上
创建挂载目录
mkdir /mnt/share
添加挂载
mount 192.168.1.212:/home/share /mnt/share
异常处理
1.mount.nfs: requested NFS version or transport protocol is not supported
启动顺序不对,先启动rpcbind,在启动nfs
2.mount.nfs: access denied by server while mounting