标签:mgr systemctl red sync exports 客户 1.3 emc info
服务端基本环境Centos6.5
[root@node1 ~]# yum -y install nfs-utils rpcbind
[root@node1 ~]# rpm -qa | grep "rpcbind"
rpcbind-0.2.0-16.el6.x86_64
[root@node1 ~]# rpm -qa | grep "nfs"
nfs-utils-lib-1.1.5-13.el6.x86_64
nfs-utils-1.2.3-78.el6_10.1.x86_64
[root@node1 ~]# vim /etc/exports
/home/data/sharedir 客户端IP(rw,sync,no_root_squash)
[root@web-01 ~]# rpcinfo -p > nfs.txt
[root@node1 ~]# vim nfs.txt
program vers proto port service 100000 4 tcp 111 portmapper 100000 3 tcp 111 portmapper 100000 2 tcp 111 portmapper 100000 4 udp 111 portmapper 100000 3 udp 111 portmapper 100000 2 udp 111 portmapper 100005 1 udp 40657 mountd 100005 1 tcp 46458 mountd 100005 2 udp 52413 mountd 100005 2 tcp 53785 mountd 100005 3 udp 60260 mountd 100005 3 tcp 44574 mountd 100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs 100003 4 tcp 2049 nfs 100227 2 tcp 2049 nfs_acl 100227 3 tcp 2049 nfs_acl 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 4 udp 2049 nfs 100227 2 udp 2049 nfs_acl 100227 3 udp 2049 nfs_acl 100021 1 udp 44067 nlockmgr 100021 3 udp 44067 nlockmgr 100021 4 udp 44067 nlockmgr 100021 1 tcp 44186 nlockmgr 100021 3 tcp 44186 nlockmgr 100021 4 tcp 44186 nlockmgr
[root@node1 ~]# tail -n +2 nfs.txt |awk ‘{print $3,$4}‘|sort -u
tcp 111 tcp 2049 tcp 44186 tcp 44574 tcp 46458 tcp 53785 udp 111 udp 2049 udp 40657 udp 44067 udp 52413 udp 60260
配置防火墙
-A INPUT -p tcp -m state --state NEW -m tcp --dport 111 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 2049 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 44186 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 44574 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 46458 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 53785 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 111 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 2049 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 40657 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 44076 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 52413 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 60260 -j ACCEPT
[root@node1 ~]# service rpcbind restart
[root@node1 ~]# service nfs restart
[root@node1 ~]# service iptables restart
[root@test ~]# yum install -y nfs-utils
[root@test ~]# cd /
[root@test /]# mkdir sharedir
[root@test /]# systemctl restart nfs
[root@test /]# showmount -e 服务端IP
[root@test /]# mount -t nfs 服务端IP:/home/data/sharedir /sharedir
也可以写进/etc/fstab实现开机挂载
[root@test /]# df -hT
服务端IP:/home/data/sharedir nfs4 110G 39G 67G 37% /sharedir
成功
标签:mgr systemctl red sync exports 客户 1.3 emc info
原文地址:https://www.cnblogs.com/zyxnhr/p/10660431.html