NFS

若如初见. 提交于 2020-01-24 05:46:57

服务端:
$ 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!