https://blog.csdn.net/weixin_43135696/article/details/118355742
查看现有端口
rpcinfo -p
vi /etc/sysconfig/nfs
#RQUOTAD_PORT=4001 #无没修改
LOCKD_TCPPORT=2803
LOCKD_UDPPORT=2769
MOUNTD_PORT=892
STATD_PORT=662
#重启
#systemctl restart portmap
systemctl restart rpcbind
systemctl restart nfs
systemctl restart nfslock
rpcinfo -p
在中添加以下设置:
vi /etc/modprobe.d/lockd.conf
options lockd nlm_tcpport=2803
options lockd nlm_udpport=2769
#重启
systemctl restart nfsconfig
systemctl restart nfsidmap
systemctl restart nfslock
systemctl restart nfs
rpcinfo -p
sysctl -a | grep resvport #查看
#设置范围
sudo sysctl -w sunrpc.min_resvport=665
sudo sysctl -w sunrpc.max_resvport=1024
客户端挂载时不使用noresvport参数,端口可以小于1024,注意检查
mount -t nfs -o vers=3,nolock,noacl,proto=tcp,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 10.3.60.40:/NFSDir /NFSDir
开机启动同理
三、常用目录
/etc/exports NFS服务的主要配置文件
/usr/sbin/exportfs NFS服务的管理命令
/usr/sbin/showmount 客户端的查看命令
/var/lib/nfs/etab 记录NFS分享出来的目录的完整权限设定值
/var/lib/nfs/xtab 记录曾经登录过的客户端信息