- 创建需要共享的文件夹
mkdir ./nfsdata
- 文件夹给全部权限
chmod 777 nfsdata/
chown nfsnobody ./nfsdata/
- 编辑 /etc/exports文件
/root/nfsdata *(rw,no_root_squash,no_all_squash,sync)
- 主节点安装
yum installl -y nfs-common nfs-utils rpcbind
- 子节点安装
yum installl -y nfs-utils rpcbind
- 启动 rpcbind
systemctl start rpcbind
- 启动 nfs
systemctl start nfs
- 子节点测试
showmount -e 主节点Ip