You are not logged in.

#1 2023-07-19 23:19:07

Wild Penguin
Member
Registered: 2015-03-19
Posts: 331

NFS v4 server fails sometimes (Cannot assign requested address)

Hi,

Sometimes, the server fails while sometimes it works correctly at reboot. If it fails, a restart (systemctl restart nfsv4-server) will bring it up correctly.

Journal says on a successful start:

Jul 15 16:53:31 ArkkiVille systemd[1]: Starting NFSv4 server and services...
Jul 15 16:53:31 ArkkiVille rpc.nfsd[1170]: rpc.nfsd: unable to bind AF_INET TCP socket: errno 98 (Address already in use)
Jul 15 16:53:31 ArkkiVille systemd[1]: Finished NFSv4 server and services.
Jul 16 05:19:04 ArkkiVille systemd[1]: Stopping NFSv4 server and services...
Jul 16 05:19:05 ArkkiVille systemd[1]: nfsv4-server.service: Deactivated successfully.
Jul 16 05:19:05 ArkkiVille systemd[1]: Stopped NFSv4 server and services.

On a fail:

Jul 18 14:36:16 ArkkiVille systemd[1]: Starting NFSv4 server and services...
Jul 18 14:36:16 ArkkiVille rpc.nfsd[1171]: rpc.nfsd: unable to bind AF_INET TCP socket: errno 98 (Address already in use)
Jul 18 14:36:16 ArkkiVille rpc.nfsd[1171]: rpc.nfsd: Unable to request RDMA services: Cannot assign requested address
Jul 18 14:36:16 ArkkiVille rpc.nfsd[1171]: rpc.nfsd: unable to set any sockets for nfsd
Jul 18 14:36:16 ArkkiVille systemd[1]: nfsv4-server.service: Main process exited, code=exited, status=1/FAILURE
Jul 18 14:36:16 ArkkiVille systemd[1]: nfsv4-server.service: Failed with result 'exit-code'.
Jul 18 14:36:16 ArkkiVille systemd[1]: Stopped NFSv4 server and services.

I suppose the line

Jul 16 13:20:53 ArkkiVille rpc.nfsd[1179]: rpc.nfsd: unable to bind AF_INET TCP socket: errno 98 (Address already in use)

Should not be there even on successful start, and indeed sometimes, it is not. I  have no idea who is reserving the address - nor am I actually sure what the error actually means. Networking is not my forte, I just fiddle enough with it so that my personal network works ;-)

Any ideas what could be causing nfs server to not start / reserve the TCP socket? Or, how should I go about finding it out?

My /etc/nfs.conf:

#
# This is a general configuration for the
# NFS daemons and tools
#
[general]
# pipefs-directory=/var/lib/nfs/rpc_pipefs
#
[nfsrahead]
# nfs=15000
# nfs4=16000
#
[exports]
# rootdir=/export
#
[exportfs]
# debug=0
#
[gssd]
# verbosity=0
# rpc-verbosity=0
# use-memcache=0
# use-machine-creds=1
# use-gss-proxy=0
# avoid-dns=1
# limit-to-legacy-enctypes=0
# context-timeout=0
# rpc-timeout=5
# keytab-file=/etc/krb5.keytab
# cred-cache-directory=
# preferred-realm=
# set-home=1
# upcall-timeout=30
# cancel-timed-out-upcalls=0
#
[lockd]
# port=0
# udp-port=0
#
[exportd]
# debug="all|auth|call|general|parse"
# manage-gids=n
# state-directory-path=/var/lib/nfs
# threads=1
# cache-use-ipaddr=n
# ttl=1800
[mountd]
# debug="all|auth|call|general|parse"
# manage-gids=n
# descriptors=0
# port=0
# threads=1
# reverse-lookup=n
# state-directory-path=/var/lib/nfs
# ha-callout=
# cache-use-ipaddr=n
# ttl=1800
#
[nfsdcld]
# debug=0
# storagedir=/var/lib/nfs/nfsdcld
#
[nfsdcltrack]
# debug=0
# storagedir=/var/lib/nfs/nfsdcltrack
#
[nfsd]
# debug=0
# threads=8
# host=
# port=0
# grace-time=90
# lease-time=90
# udp=n
# tcp=y
# vers3=y
# vers4=y
# vers4.0=y
# vers4.1=y
# vers4.2=y
rdma=y
rdma-port=20049

[statd]
# debug=0
# port=0
# outgoing-port=0
# name=
# state-directory-path=/var/lib/nfs/statd
# ha-callout=
# no-notify=0
#
[sm-notify]
# debug=0
# force=0
# retry-time=900
# outgoing-port=
# outgoing-addr=
# lift-grace=y
#
[svcgssd]
# principal=

AFAIK the only other network servers running on the same computer are sshd and monitorix (a simple http server) for completeness sake.

Cheers!

p.s. Only configuration change I've done recently, is changed to NFS v4 from v3. I mainly use NFS to share music/video files to my KODI client. I've changed to v4 so that I can more easily monitor how many clients are actually using NFS (mainly to conserve power - I want the server to go down if not used, but stay up if in use). With v3, the nfs server always started without any issues.

Offline

Board footer

Powered by FluxBB