服务端:
$ yum install -y nfs-utils rpcbind
vim /etc/sysconfig/nfs
RQUOTAD_PORT=30001
LOCKD_TCPPORT=30002
LOCKD_UDPPORT=30002
MOUNTD_PORT=30003
STATD_PORT=30004
#防火墙
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.0.1.146" port protocol="tcp" port="111" accept"
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.0.1.146" port protocol="udp" port="111" accept"
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.0.1.146" port protocol="tcp" port="2049" accept"
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.0.1.146" port protocol="udp" port="2049" accept"
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.0.1.146" port protocol="tcp" port="30001" accept"
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.0.1.146" port protocol="udp" port="30001" accept"
firewall-cmd --reload # 配置立即生效
vim /etc/exports
/total/files 192.168.0.1(rw,sync)
#重启
service rpcbind restart
service nfs restart
客户端
$ yum install -y nfs-utils autofs
vim /etc/auto.master
/opt/cz /etc/auto.nfs
vim /etc/auto.nfs
path -fstype=nfs -rw,sync 192.168.0.2:/total/files
systemctl restart autofs
df -h
cd /opt/cz/path
来源:CSDN
作者:哎哟喂呢哈
链接:https://blog.csdn.net/qq_41958741/article/details/103928536