CentOS 7客户端无法通过NFSv4挂载Rocky 8存储服务器共享目录的问题求助
CentOS 7客户端无法通过NFSv4挂载Rocky 8存储服务器共享目录的问题求助
大家好,我最近遇到了一个NFSv4的兼容性问题,折腾了好久没搞定,想请各位帮忙分析下:
环境背景
- 存储服务器:运行Rocky 8,提供NFS共享服务,其中一个共享目录所在的文件系统是ZFS,另一个则不是
- 客户端:包含Rocky 8、CentOS 7、Debian 10/11三类系统,通过NFS访问不同的导出目录
当前NFSv3的正常状态
NFSv3下所有客户端都能正常工作,我的/etc/exports配置如下:
/hpc/projects 10.0.20.100/32(rw,crossmnt,async,no_root_squash,no_subtree_check) 10.33.4.0/22(rw,crossmnt,nohide,async,no_root_squash,no_subtree_check) 10.34.4.0/22(rw,crossmnt,nohide,async,no_root_squash,no_subtree_check) /hpc/projects/subdir1 10.0.20.101/32(rw,crossmnt,async,no_root_squash,no_subtree_check) /hpc/projects/subdir2 10.0.20.102/32(rw,crossmnt,async,no_root_squash,no_subtree_check) /hpc/projects/subdir3 10.0.20.103/32(rw,crossmnt,async,no_root_squash,no_subtree_check) /scratch 10.33.4.0/22(rw,async,no_root_squash,no_subtree_check) 10.34.4.0/22(rw,async,no_root_squash,no_subtree_check)
NFSv4遇到的异常(仅CentOS 7客户端失败)
切换到NFSv4后,只有CentOS 7客户端无法正常挂载,Rocky 8和Debian客户端都能正常使用NFSv4。我已经尝试过两种NFS根目录配置:
- 将ZFS挂载点
/hpc设为NFS根 - 使用单独创建的
/export目录作为NFS根
两种配置都没能解决问题,以下是我以/hpc作为NFS根的/etc/exports配置:
/hpc *(fsid=0,ro,insecure) /hpc/projects 10.0.20.100/32(rw,crossmnt,async,no_root_squash,no_subtree_check,insecure) 10.33.4.0/22(rw,crossmnt,nohide,async,no_root_squash,no_subtree_check,insecure) 10.34.4.0/22(rw,crossmnt,nohide,async,no_root_squash,no_subtree_check,insecure) /hpc/projects/subdir1 10.0.20.101/32(rw,crossmnt,async,no_root_squash,no_subtree_check,insecure) /hpc/projects/subdir2 10.0.20.102/32(rw,crossmnt,async,no_root_squash,no_subtree_check,insecure) /hpc/projects/subdir3 10.0.20.103/32(rw,crossmnt,async,no_root_squash,no_subtree_check,insecure) /scratch 10.33.4.0/22(rw,async,no_root_squash,no_subtree_check) 10.34.4.0/22(rw,async,no_root_squash,no_subtree_check)
具体错误信息
挂载NFSv4根目录时的错误:
执行命令:mount -vvv -t nfs4 10.34.4.100:/ mnt
返回错误:mount.nfs4: access denied by server while mounting 10.34.4.100:/挂载
/hpc子目录的异常:
执行命令:mount -vvv -t nfs4 10.34.4.100:/hpc mnt
虽然挂载成功,但查看mount输出后发现,实际使用的是NFSv3协议:10.34.4.100:/hpc on /mnt type nfs (rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.34.4.100,mountvers=3,mountport=20048,mountproto=udp,local_lock=none,addr=10.34.4.108)可以清楚看到
vers=3和mountvers=3,完全没有按照指定使用NFSv4。服务器日志(
/var/log/messages)中的拒绝记录:Mar 30 10:56:12 servername rpc.mountd[14813]: refused mount request from 10.34.4.1 for / (/): not exported Mar 30 10:56:15 servername rpc.mountd[14813]: refused mount request from 10.34.4.1 for /hpc (/): not exported
补充说明
/scratch目录在NFSv4配置下,CentOS 7客户端可以正常挂载- 为了排除干扰,服务器和CentOS 7客户端都已经禁用SELinux,且服务器暂时关闭了防火墙用于测试
现在实在搞不懂为什么只有CentOS 7客户端在NFSv4下出问题,想请教各位有没有排查方向或者解决方案?
备注:内容来源于stack exchange,提问作者Chris Woelkers
相关产品推荐
相关产品推荐

