我们已经安装了iptables,它允许TCP / UDP端口111 2049 32769 32803 892
..我在/ etc / sysconfig / nfs中进行了以下更改
RPCMOUNTDOPTS =“ – p 892”
和
/etc/sysctl.conf中
fs.nfs.nlm_tcpport = 32803
fs.nfs.nlm_udpport = 32769
根据redhat文档中的规定,在Redhat / Centos 7中的防火墙之后运行nfs
ref – https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Storage_Administration_Guide/nfs-serverconfig.html
仍nfs没有绑定到这个提供的端口,并采取任何限制任何客户端连接到nfs由于iptables的随机端口..我们不能阻止iptables ..
尝试与rpc.mountd -p 892这个命令,但似乎不工作..
o / p – rpcinfo -p
程序vers proto端口服务
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 100024 1 udp 46390 status 100024 1 tcp 38521 status 100005 1 udp 20048 mountd 100005 1 tcp 20048 mountd 100005 2 udp 20048 mountd 100005 2 tcp 20048 mountd 100005 3 udp 20048 mountd 100005 3 tcp 20048 mountd 100003 3 tcp 2049 nfs 100003 4 tcp 2049 nfs 100227 3 tcp 2049 nfs_acl 100003 3 udp 2049 nfs 100003 4 udp 2049 nfs 100227 3 udp 2049 nfs_acl 100021 1 udp 40472 nlockmgr 100021 3 udp 40472 nlockmgr 100021 4 udp 40472 nlockmgr 100021 1 tcp 35454 nlockmgr 100021 3 tcp 35454 nlockmgr 100021 4 tcp 35454 nlockmgr
任何有关这个世界的帮助表示赞赏。
那么/usr/lib/systemd/system/nfs-mountd.service使用$ RPCMOUNTDARGS选项调用rpc.mountd,该选项与/ etc / sysconfig / nfs中的RPCMOUNTDOPTS不同。
还有一个名为nfs-config.service的服务,它预处理NFSconfiguration并将其输出到/ run / sysconfig / nfs-utils,RPCMOUNTDOPTS转换为RPCMOUNTDARGS。
nfs.service虽然在使用停止/启动或重新启动时不记得nfs-config,所以/ etc / sysconfig / nfs中的configuration不会更新/ run / sysconfig / nfs-utils。
解决方法很简单,在重新启动nfs.service之前运行'systemctl restart nfs-config'。