无法从客户端挂载远程 NFSv4 共享

无法从客户端挂载远程 NFSv4 共享

前提是:
我有NFSv4(仅)在 Centos7 下配置并运行良好的服务器,导出如下(它是沙盒环境,因此没有安全问题):

server> cat /etc/exports
/export/dcs       *(sec=sys,rw,no_root_squash,sync,no_subtree_check)
server> cat /proc/fs/nfsd/versions
-2 -3 +4 +4.1 +4.2
server> 

我知道 NFSv4 服务器及其配置的共享工作正常,因为我能够从 MacOS (Monterey) 和远程 docker 容器(在 Centos7 下)安装它。

问题:
但是,在一台特定机器(也是 Centos 7)上,安装后nfs-utils,我无法挂载相同的共享:

bash# rpm -qa | grep nfs-utils
nfs-utils-1.3.0-0.65.el7.i686
bash#
bash# mkdir -p /mnt/nfs
bash#
bash# mount.nfs4 10.1.2.3:/export/dsc /mnt/nfs
mount.nfs4: Protocol not supported
bash# 

A) 我知道 tcp 和 udp nfs 端口 (2049) 可以从客户端访问 - 通过netcat
B) 进行验证,当 s-tracing 时,mount.nfs4我看到此失败:

bash# strace mount.nfs4 10.1.2.3:/export/dsc /mnt/nfs
...
socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP) = 3
bind(3, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
connect(3, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("10.1.2.3")}, 16) = 0
getsockname(3, {sa_family=AF_INET, sin_port=htons(57709), sin_addr=inet_addr("10.4.5.6")}, [16]) = 0
close(3)                                = 0
mount("10.1.2.3:/export/dsc", "/mnt/nfs", "nfs4", 0, "vers=4.1,addr=10.1.2.3,client"...) = -1 EPROTONOSUPPORT (Protocol not supported)
...

mount()调用返回的错误( EPROTONOSUPPORT) 与某些本地/客户端检查有关,因为当我tcpdump在服务器上运行时,我观察到客户端计算机在mount操作期间没有发送任何数据包。

我也尝试安装:LIBMOUNT_DEBUG=0xffff mount.nfs4 -vvv 10.1.2.3:/export/dsc /mnt/nfs但它没有显示任何明显的失败:

bash# LIBMOUNT_DEBUG=0xffff mount.nfs4 -vvv 10.1.2.3:/export/dsc /mnt/nfs
5733: libmount:     INIT: library debug mask: 0xffff
5733: libmount:     INIT: library version: 2.23.0
5733: libmount:     INIT:     feature: selinux
5733: libmount:     INIT:     feature: debug
5733: libmount:     INIT:     feature: assert
5733: libmount:      CXT: [0x576b2008]: ----> allocate 
5733: libmount:    UTILS: mtab: /etc/mtab
5733: libmount:    UTILS: /etc/mtab: irregular/non-writable
5733: libmount:    UTILS: utab: /run/mount/utab
5733: libmount:    UTILS: try write /run/mount/utab dir: /run/mount
5733: libmount:    UTILS:  access OK [/run/mount]
5733: libmount:      CXT: [0x576b2008]: enabling flag 0020
5733: libmount:      CXT: [0x576b2008]: enabling flag 2000000
5733: libmount:      CXT: [0x576b2008]: initialized for [u]mount.<type> helper [rc=0]
5733: libmount:      CXT: [0x576b2008]: enabling flag 0010
5733: libmount:      CXT: [0x576b2008]: enabling flag 0010
5733: libmount:      CXT: [0x576b2008]: enabling flag 0010
5733: libmount:    CACHE: [0x576b2158]: alloc
5733: libmount:    CACHE: [0x576b2158]: add entry [ 1] (path): /mnt/nfs: /mnt/nfs
5733: libmount:      CXT: [0x576b2008]: use default optmode
5733: libmount:      CXT: [0x576b2008]: OPTSMODE: ignore=0, append=0, prepend=1, replace=0, force=0, fstab=1, mtab=1
5733: libmount:      CXT: [0x576b2008]: fstab not required -- skip
5733: libmount:      CXT: [0x576b2008]: mount: preparing
5733: libmount:      CXT: [0x576b2008]: OPTSMODE: ignore=0, append=0, prepend=1, replace=0, force=0, fstab=1, mtab=1
5733: libmount:      CXT: [0x576b2008]: fstab not required -- skip
5733: libmount:      CXT: [0x576b2008]: merging mount flags
5733: libmount:      CXT: [0x576b2008]: final flags: VFS=00000000 user=00000000
5733: libmount:      CXT: [0x576b2008]: mount: evaluating permissions
5733: libmount:      CXT: [0x576b2008]: mount: fixing optstr
5733: libmount:      CXT: [0x576b2008]: mount: fixing vfs optstr
5733: libmount:      CXT: applying 0x00000000 flags to '(null)'
5733: libmount:      CXT: new optstr 'rw'
5733: libmount:      CXT: [0x576b2008]: mount: fixing user optstr
5733: libmount:      CXT: applying 0x00000000 flags to '(null)'
5733: libmount:      CXT: new optstr '(null)'
5733: libmount:      CXT: [0x576b2008]: fixed options [rc=0]: vfs: 'rw' fs: '(null)' user: '(null)', optstr: 'rw'
5733: libmount:      CXT: [0x576b2008]: preparing source path
5733: libmount:      CXT: [0x576b2008]: preparing target path
5733: libmount:      CXT: [0x576b2008]: final target '/mnt/nfs'
5733: libmount:      CXT: [0x576b2008]: FS type: nfs4 [rc=0]
mount.nfs4: timeout set for Tue Apr 18 11:20:16 2023
mount.nfs4: trying text-based options 'vers=4.1,addr=10.1.2.3,clientaddr=10.4.5.6'
mount.nfs4: mount(2): Protocol not supported
mount.nfs4: trying text-based options 'vers=4.0,addr=10.1.2.3,clientaddr=10.4.5.6'
mount.nfs4: mount(2): Protocol not supported
mount.nfs4: Protocol not supported
5733: libmount:      CXT: [0x576b2008]: syscall status set to: -1
5733: libmount:      CXT: [0x576b2008]: prepare update
5733: libmount:      CXT: [0x576b2008]: skip update: syscall failed [status=-1]
5733: libmount:      CXT: [0x576b2008]: don't update: no update prepared
5733: libmount:      CXT: [0x576b2008]: <---- reset [status=0] ---->
5733: libmount:      CXT: [0x576b2008]: tabfiler disabled
5733: libmount:    CACHE: [0x576b2158]: free
5733: libmount:      CXT: [0x576b2008]: <---- free
bash# 

客户端上出现该错误的原因是什么(知道这不是协议版本协商的结果)?以及如何进一步解决这个问题?

UPD,额外的调试信息(根据@aviro的要求):

mount.nfs4这是运行期间收集的 rpcdebug :

Apr 24 14:52:52 nfsclient kernel: [13064.997882] NFS: nfs mount opts='vers=4.1,addr=10.1.2.3,clientaddr=10.4.5.6'
Apr 24 14:52:52 nfsclient kernel: [13064.997884] NFS:   parsing nfs mount option 'vers=4.1'
Apr 24 14:52:52 nfsclient kernel: [13064.997890] NFS:   parsing nfs mount option 'addr=10.1.2.3'
Apr 24 14:52:52 nfsclient kernel: [13064.997894] NFS:   parsing nfs mount option 'clientaddr=10.4.5.6'
Apr 24 14:52:52 nfsclient kernel: [13064.997897] NFS: MNTPATH: '/export/disco'
Apr 24 14:52:52 nfsclient kernel: [13065.000040] NFS: nfs mount opts='vers=4.0,addr=10.1.2.3,clientaddr=10.4.5.6'
Apr 24 14:52:52 nfsclient kernel: [13065.000042] NFS:   parsing nfs mount option 'vers=4.0'
Apr 24 14:52:52 nfsclient kernel: [13065.000047] NFS:   parsing nfs mount option 'addr=10.1.2.3'
Apr 24 14:52:52 nfsclient kernel: [13065.000050] NFS:   parsing nfs mount option 'clientaddr=10.4.5.6'
Apr 24 14:52:52 nfsclient kernel: [13065.000053] NFS: MNTPATH: '/export/disco'

并输出strace -s1024

https://pastebin.ubuntu.com/p/8mMZmgR8w9/

(发布在那里,因为输出太大,无法放在这里)

附言。请不要提供升级nfs-utilsRPM - 同样的 RPM 在另一个启动(docker 环境)中工作正常,而且它超出了我的控制范围。

相关内容