1. 程式人生 > >Set nfs server on rhel7

Set nfs server on rhel7

client cmd document href rman lld inf ssh pre

server 端安裝:

# yum install nfs-utils rpcbind
# mkdir -p /opt/dir
# cat /etc/exports
/opt/dir   *(rw,sync,no_root_squash)

server端需要打開相關的端口firewalld配置

# 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