假设主机192.168.10.1要访问192.168.10.137的/home目录,配置步骤如下:
# 1 关闭192.168.10.137下的防火墙和SELinux
systemctl stop firewalld.service
setenforce 0
# 2 192.168.10.137上安装nfs-utils和portmap
yum install -y nfs-utils
yum install -y portmap
# 3 修改192.168.10.137上的配置
vim /etc/exports
/home -rw -sync -no_root_squash -network 192.168.10.1
# 4 重启服务192.168.10.137上的服务
systemctl restart nfs
systemctl restart rpcbind
# 5 在192.168.10.1节点上mount到192.168.10.137
mount -t nfs 192.168.10.137:/home /home/nfv/data/mount/sp1-mount
# 6 在192.168.10.137查看mount情况
showmount -e
Export list for nfv-sp-01:
/home 192.168.10.1