server 端安装:
- # yum install nfs-utils rpcbind
- # mkdir -p /opt/dir
- # cat /etc/exports
- /opt/dir *(rw,sync,no_root_squash)
server 端需要打开相关的端口 firewalld 配置 https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/storage_administration_guide/s2-nfs-nfs-firewall-config
- # firewall-cmd --add-service=nfs --zone=public --permanent
- # firewall-cmd --add-service=mountd --zone=public --permanent
- # firewall-cmd --add-service=rpc-bind --zone=public --permanent
- # firewall-cmd --reload
- # firewall-cmd --list-all
- public
- target: default
- icmp-block-inversion: no
- interfaces:
- sources:
- services: ssh dhcpv6-client nfs mountd rpc-bind
- # service rpcbind start; service nfs start
- ...
client 端配置:
- # yum install nfs-utils rpcbind
- # service rpcbind start
- # mkdir -p /mnt/mig
client 端查看:
- # rpcinfo -p ${server's ip}
- ...
- # showmount -e ${server's ip}
- Export list for ...
- /opt/dir *
- # mount -t nfs ${server's ip}:/opt/dir /mnt/mig -vvvv ###for debug
- ...
- # mount -t nfs ${server's ip}:/opt/dir /mnt/mig -o vers=3 ###mount by v3
- Set nfs server on rhel7
来源: http://www.bubuko.com/infodetail-2740035.html