nfsd doesn't register with rpcbind
Rick Macklem
rmacklem at uoguelph.ca
Mon Jan 11 14:15:25 UTC 2021
Ondra Knezour wrote:
[stuff snipped]
>So my questions are:
>1. Why my nfsd doesn't register with rpcbind?
>2. Is this registration somewhat optional at least for NFSv4?
NFSv4 does not use rpcbind. This is generally considered a feature
and not a bug.
--> nfsd will register with rpcbind only if NFSv3 is enabled. (see below)
>3. How can I get some useful debug info? Using -d options in our servers
>startup configuration where it is available doesn't produce much.
[more stuff snipped]
>microcode_update_enable="YES"
>rpc_lockd_enable="YES" # Run NFS rpc.lockd needed for client/server.
>rpc_statd_enable="YES" # Run NFS rpc.statd needed for client/server.
These are sideband protocols used with NFSv3. If all your mounts are NFSv4,
you don't need them.
>
>/etc/sysctl.conf
>
>vfs.zfs.arc_max="48000000000"
>vfs.nfsd.server_min_nfsvers=4
vfs.nfsd.server_min_nfsvers=3
--> Will make it register with rpcbind.
>vfs.nfs.enable_uidtostring=1
You would normally also want
vfs.nfs.enable_stringtouid=1
which applies to server as well as
client. If you never run nfsuserd,
then I think it defaults to this anyhow.
In summary, if you want it to register
with rpcbind, enable NFSv3.
rick
vfs.nfsd.tcpcachetimeo: 300
vfs.nfsd.tcphighwater: 100000
/etc/exports
/zdata/email -maproot=root 10.128.99.79
/zdata/nf -maproot=root 172.22.255.249
/zdata/odkladgalery -maproot=root 172.22.1.10
/zdata/ios -maproot=root 172.22.1.14
/zdata/xen-iso-library -maproot=root 172.22.1.27
/zdata/xen-iso-library -maproot=root 172.22.1.7
/zdata/xen-nfs-storage -maproot=root 172.22.1.27
/zdata/xen-nfs-storage -maproot=root 172.22.1.7
/zdata/servers/xenserver -maproot=root 172.22.1.27
/zdata/servers/xenserver -maproot=root 172.22.1.7
/zdata/servers/xenserver -maproot=root 172.22.1.32
/zdata/virt -maproot=root 172.22.1.27
/zdata/virt -maproot=root 172.22.1.7
/zdata/virt -maproot=root 172.22.1.13
/zdata/virt -maproot=root 172.22.1.2
/zdata/virt -maproot=root -sec=sys 172.22.1.11
V4: / -sec=sys -network 172.22.0.0 -mask 255.255.0.0
V4: / -sec=sys -network 10.128.99.0 -mask 255.255.255.0
rpcinfo -s
program version(s) netid(s) service owner
100000 2,3,4 local,udp6,tcp6,udp,tcp rpcbind superuser
100024 1 tcp,udp,tcp6,udp6 status superuser
100021 4,3,1,0 tcp,udp,tcp6,udp6 nlockmgr superuser
100005 3,1 tcp,udp,tcp6,udp6 mountd superuser
And from one of the Linux clients - rpcinfo doesn't show nfsd, but
mounts can be probed and mounted without problem.
showmount -e 172.22.1.4
Export list for 172.22.1.4:
/zdata/virt 172.22.1.11,172.22.1.2,172.22.1.13,172.22.1.7,172.22.1.27
/zdata/xen-nfs-storage 172.22.1.7,172.22.1.27
/zdata/xen-iso-library 172.22.1.7,172.22.1.27
/zdata/odkladgalery 172.22.1.10
/zdata/email 10.128.99.79
/zdata/servers/xenserver 172.22.1.32,172.22.1.7,172.22.1.27
/zdata/ios 172.22.1.14
/zdata/nf 172.22.255.249
rpcinfo -s 172.22.1.4
program version(s) netid(s) service owner
100000 2,3,4 local,udp6,tcp6,udp,tcp portmapper superuser
100024 1 tcp,udp,tcp6,udp6 status superuser
100021 4,3,1,0 tcp,udp,tcp6,udp6 nlockmgr superuser
100005 3,1 tcp,udp,tcp6,udp6 mountd superuser
mount.nfs4 172.22.1.4:/zdata/xen-iso-storage /iso-storage/
mount.nfs4 172.22.1.4:/zdata/xen-iso-library /iso-storage/
mount
172.22.1.4:/zdata/xen-iso-library on /iso-storage type nfs4 (rw,relatime,vers=4.1,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.22.1.7,local_lock=none,addr=172.22.1.4)
172.22.1.4:/zdata/xen-nfs-storage on /nfs-storage type nfs4 (rw,relatime,vers=4.1,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.22.1.7,local_lock=none,addr=172.22.1.4)
Digging again deeper, I see in log on the client, that missing nfsd in
rpcinfo -s call is probably main culprit here. From where came "missing
serverpath" error I don't know. Also setting rpcdebug -m [nfs|rpc] -s
all (set all debug flags for those two modules) on client yeld nothing
at all.
Dec 27 22:31:36 xen-2u SM: [25530] _testHost: Testing host/port: storage-smc.ujezd.net,2049
Dec 27 22:31:36 xen-2u SM: [25530] scanning2 (target=storage-smc.ujezd.net)
Dec 27 22:31:36 xen-2u SM: [25530] scanning
Dec 27 22:31:36 xen-2u SM: [25530] ['/usr/sbin/showmount', '--no-headers', '-e', 'storage-smc.ujezd.net']
Dec 27 22:31:36 xen-2u SM: [25530] pread SUCCESS
Dec 27 22:31:36 xen-2u SM: [25530] Raising exception [101, The request is missing the serverpath parameter]
Dec 27 22:31:36 xen-2u SM: [25530] lock: released /var/lock/sm/sr
Dec 27 22:31:36 xen-2u SM: [25530] ***** generic exception: sr_probe: EXCEPTION <class 'SR.SROSError'>, The request is missing the serverpath parameter
Dec 27 22:31:36 xen-2u SM: [25530] File "/opt/xensource/sm/SRCommand.py", line 110, in run
Dec 27 22:31:36 xen-2u SM: [25530] return self._run_locked(sr)
Dec 27 22:31:36 xen-2u SM: [25530] File "/opt/xensource/sm/SRCommand.py", line 159, in _run_locked
Dec 27 22:31:36 xen-2u SM: [25530] rv = self._run(sr, target)
Dec 27 22:31:36 xen-2u SM: [25530] File "/opt/xensource/sm/SRCommand.py", line 332, in _run
Dec 27 22:31:36 xen-2u SM: [25530] txt = sr.probe()
Dec 27 22:31:36 xen-2u SM: [25530] File "/opt/xensource/sm/NFSSR", line 164, in probe
Dec 27 22:31:36 xen-2u SM: [25530] self.validate_remotepath(True)
Dec 27 22:31:36 xen-2u SM: [25530] File "/opt/xensource/sm/NFSSR", line 109, in validate_remotepath
Dec 27 22:31:36 xen-2u SM: [25530] raise xs_errors.XenError('ConfigServerPathMissing')
Dec 27 22:31:36 xen-2u SM: [25530]
Dec 27 22:31:36 xen-2u SM: [25530] ***** NFS VHD: EXCEPTION <class 'SR.SROSError'>, The request is missing the serverpath parameter
Dec 27 22:31:36 xen-2u SM: [25530] File "/opt/xensource/sm/SRCommand.py", line 378, in run
Dec 27 22:31:36 xen-2u SM: [25530] ret = cmd.run(sr)
Dec 27 22:31:36 xen-2u SM: [25530] File "/opt/xensource/sm/SRCommand.py", line 110, in run
Dec 27 22:31:36 xen-2u SM: [25530] return self._run_locked(sr)
Dec 27 22:31:36 xen-2u SM: [25530] File "/opt/xensource/sm/SRCommand.py", line 159, in _run_locked
Dec 27 22:31:36 xen-2u SM: [25530] rv = self._run(sr, target)
Dec 27 22:31:36 xen-2u SM: [25530] File "/opt/xensource/sm/SRCommand.py", line 332, in _run
Dec 27 22:31:36 xen-2u SM: [25530] txt = sr.probe()
Dec 27 22:31:36 xen-2u SM: [25530] File "/opt/xensource/sm/NFSSR", line 164, in probe
Dec 27 22:31:36 xen-2u SM: [25530] self.validate_remotepath(True)
Dec 27 22:31:36 xen-2u SM: [25530] File "/opt/xensource/sm/NFSSR", line 109, in validate_remotepath
Dec 27 22:31:36 xen-2u SM: [25530] raise xs_errors.XenError('ConfigServerPathMissing')
Dec 27 22:31:36 xen-2u SM: [25530]
Dec 27 22:32:02 xen-2u SM: [25713] sr_create {'sr_uuid': '34c61bf5-32d6-a0b7-47e7-65209f69ddb9', 'subtask_of': 'DummyRef:|2360ef68-4b8d-4db8-8943-ec4370f77fa7|SR.create', 'args': ['0'], 'host_ref': 'OpaqueRef:2669e2f3-300e-4748-916f-5811c337e830', 'session_ref': 'OpaqueRef:8f327b0d-9799-420e-8164-a81353aa99ee', 'device_config': {'location': 'storage-smc.ujezd.net:/zdata/xen-iso-library', 'type': 'nfs_iso', 'SRmaster': 'true', 'nfsversion': '4'}, 'command': 'sr_create', 'sr_ref': 'OpaqueRef:55ecd645-3bf5-4a06-8aae-79443b019047'}
Dec 27 22:32:02 xen-2u SM: [25713] _testHost: Testing host/port: storage-smc.ujezd.net,2049
Dec 27 22:32:02 xen-2u SM: [25713] ['/usr/sbin/rpcinfo', '-s', 'storage-smc.ujezd.net']
Dec 27 22:32:02 xen-2u SM: [25713] pread SUCCESS
Dec 27 22:32:02 xen-2u SM: [25713] NFS service not ready on server storage-smc.ujezd.net
And this is part of the code I suspect produces that error
RPCINFO_BIN = "/usr/sbin/rpcinfo"
SHOWMOUNT_BIN = "/usr/sbin/showmount"
[...]
def check_server_service(server):
"""Ensure NFS service is up and available on the remote server.
Returns False if fails to detect service after
NFS_SERVICE_RETRY * NFS_SERVICE_WAIT
"""
retries = 0
errlist = [errno.EPERM, errno.EPIPE, errno.EIO]
while True:
try:
services = util.pread([RPCINFO_BIN, "-s", "%s" % server])
services = services.split("\n")
for i in range(len(services)):
if services[i].find("nfs") > 0:
return True
except util.CommandException, inst:
if not int(inst.code) in errlist:
raise
util.SMlog("NFS service not ready on server %s" % server)
retries += 1
if retries >= NFS_SERVICE_RETRY:
break
time.sleep(NFS_SERVICE_WAIT)
return False
[...]
Best regards
Ondra Knezour
More information about the freebsd-net
mailing list