服务端
- 安装所需软件包,
rpcbind
和nfs-utils
- 先为
rpcbind
和nfs
做开机启动:(必须先启动rpcbind
服务)
systemctl enable rpcbind.service
systemctl enable nfs-server.service
systemctl start rpcbind.service
systemctl start nfs-server.service
- 编辑配置文件
/etc/exports
/data 222.204.4.0/24(rw)
/home 222.204.4.0/24(rw)
- 使配置生效
exportfs -r
- 查看是否共享成功
exportfs
- 使用
rpcinfo -p
查看端口,并开放相应端口
客户端
- 安装所需软件包
rpcbind
和nfs-utils
- 启动
rpcbind
并设置开机启动 - 查看远程主机共享目录
showmount -e IP
- 挂载NFS共享目录
mount -t nfs4 222.204.4.5:/data /remote/simulation/data/