LINUX.ORG.RU
решено ФорумAdmin

NFS сервер не стартует

 ,


0

1

Имеем Gentoo с ванильным ядром 4.7.5, systemd и параметрами:

smt-server ~ # zcat /proc/config.gz | grep -i nfs
CONFIG_KERNFS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V2=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
# CONFIG_NFS_SWAP is not set
# CONFIG_NFS_V4_1 is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
CONFIG_NFSD=y
CONFIG_NFSD_V2_ACL=y
CONFIG_NFSD_V3=y
CONFIG_NFSD_V3_ACL=y
CONFIG_NFSD_V4=y
CONFIG_NFSD_PNFS=y
CONFIG_NFSD_BLOCKLAYOUT=y
CONFIG_NFSD_SCSILAYOUT=y
CONFIG_NFSD_V4_SECURITY_LABEL=y
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_COMMON=y

Установлен nfs-utils-1.3.4, в /etc/exports:

/srv/nfs 192.168.0.0/48(sync,rw,nohide,all_squash,no_subtree_check,anonuid=1000,anongid=1000,insecure)

/etc/hosts.allow:

portmap: 192.168.0.0/48
lockd:   192.168.0.0/48
rquotad: 192.168.0.0/48
mountd:  192.168.0.0/24
statd:   192.168.0.0/24

При попытке старта nfs (systemctl start nfs-server) получаем очень долгое висение и затем ошибки

systemctl status:

smt-server ~ # systemctl status nfs-idmapd          
● nfs-idmapd.service - NFSv4 ID-name mapping service
   Loaded: loaded (/usr/lib/systemd/system/nfs-idmapd.service; static; vendor preset: disabled)
   Active: active (running) since Вс 2016-12-25 23:39:41 MSK; 28min ago
  Process: 9181 ExecStart=/usr/sbin/rpc.idmapd $RPCIDMAPDARGS (code=exited, status=0/SUCCESS)
 Main PID: 9228 (rpc.idmapd)
   Memory: 928.0K
      CPU: 4ms
   CGroup: /system.slice/nfs-idmapd.service
           └─9228 /usr/sbin/rpc.idmapd

дек 25 23:39:41 smt-server systemd[1]: Starting NFSv4 ID-name mapping service...
дек 25 23:39:41 smt-server systemd[1]: Started NFSv4 ID-name mapping service.

smt-server ~ # systemctl status nfs-mountd      
● nfs-mountd.service - NFS Mount Daemon
   Loaded: loaded (/usr/lib/systemd/system/nfs-mountd.service; static; vendor preset: disabled)
   Active: active (running) since Вс 2016-12-25 23:39:41 MSK; 28min ago
  Process: 9164 ExecStart=/usr/sbin/rpc.mountd $RPCMOUNTDARGS (code=exited, status=0/SUCCESS)
 Main PID: 9213 (rpc.mountd)
   Memory: 892.0K
      CPU: 17ms
   CGroup: /system.slice/nfs-mountd.service
           └─9213 /usr/sbin/rpc.mountd

дек 25 23:39:41 smt-server systemd[1]: Starting NFS Mount Daemon...
дек 25 23:39:41 smt-server systemd[1]: Started NFS Mount Daemon.
дек 25 23:39:41 smt-server rpc.mountd[9213]: Version 1.3.3 starting

smt-server ~ # systemctl status nfs-utils       
● nfs-utils.service - NFS server and client services
   Loaded: loaded (/usr/lib/systemd/system/nfs-utils.service; static; vendor preset: disabled)
   Active: inactive (dead)

smt-server ~ # systemctl status rpc-statd-notify
● rpc-statd-notify.service - Notify NFS peers of a restart
   Loaded: loaded (/usr/lib/systemd/system/rpc-statd-notify.service; static; vendor preset: disabled)
   Active: inactive (dead)

smt-server ~ # systemctl status rpc-statd       
● rpc-statd.service - NFS status monitor for NFSv2/3 locking.
   Loaded: loaded (/usr/lib/systemd/system/rpc-statd.service; static; vendor preset: disabled)
   Active: failed (Result: exit-code) since Вс 2016-12-25 23:39:41 MSK; 29min ago
  Process: 9148 ExecStart=/sbin/rpc.statd --no-notify $STATDARGS (code=exited, status=1/FAILURE)

дек 25 23:39:41 smt-server rpc.statd[9171]: Version 1.3.3 starting
дек 25 23:39:41 smt-server rpc.statd[9171]: Flags: TI-RPC
дек 25 23:39:41 smt-server rpc.statd[9171]: Running as root.  chown /var/lib/nfs to choose different user
дек 25 23:39:41 smt-server rpc.statd[9171]: Failed to register (statd, 1, udp): svc_reg() err: RPC: Remote system error - Connection refused
дек 25 23:39:41 smt-server rpc.statd[9171]: Failed to register (statd, 1, tcp): svc_reg() err: RPC: Remote system error - Connection refused
дек 25 23:39:41 smt-server rpc.statd[9171]: Failed to register (statd, 1, udp6): svc_reg() err: RPC: Remote system error - Connection refused
дек 25 23:39:41 smt-server systemd[1]: rpc-statd.service: Control process exited, code=exited status=1
дек 25 23:39:41 smt-server systemd[1]: Failed to start NFS status monitor for NFSv2/3 locking..
дек 25 23:39:41 smt-server systemd[1]: rpc-statd.service: Unit entered failed state.
дек 25 23:39:41 smt-server systemd[1]: rpc-statd.service: Failed with result 'exit-code'.

smt-server ~ # systemctl status nfs-server      
● nfs-server.service - NFS server and services
   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled)
   Active: activating (start) since Вс 2016-12-25 23:39:41 MSK; 29min ago
  Process: 9239 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
 Main PID: 9255 (rpc.nfsd)
   Memory: 352.0K
      CPU: 6ms
   CGroup: /system.slice/nfs-server.service
           └─9255 /usr/sbin/rpc.nfsd

дек 25 23:39:41 smt-server systemd[1]: Starting NFS server and services...

smt-server ~ # # спустя какое-то время
smt-server ~ # systemctl status nfs-server      
● nfs-server.service - NFS server and services
   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Пн 2016-12-26 00:11:07 MSK; 5min ago
  Process: 9255 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=1/FAILURE)
  Process: 9239 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
 Main PID: 9255 (code=exited, status=1/FAILURE)

дек 25 23:39:41 smt-server systemd[1]: Starting NFS server and services...
дек 26 00:11:07 smt-server rpc.nfsd[9255]: rpc.nfsd: writing fd to kernel failed: errno 110 (Connection timed out)
дек 26 00:11:07 smt-server rpc.nfsd[9255]: rpc.nfsd: unable to set any sockets for nfsd
дек 26 00:11:07 smt-server systemd[1]: nfs-server.service: Main process exited, code=exited, status=1/FAILURE
дек 26 00:11:07 smt-server systemd[1]: Failed to start NFS server and services.
дек 26 00:11:07 smt-server systemd[1]: nfs-server.service: Unit entered failed state.
дек 26 00:11:07 smt-server systemd[1]: nfs-server.service: Failed with result 'exit-code'.


ЧЯДНТ?

Либо оно самопочинилось, либо systemctl start rpcbind



Последнее исправление: smt (всего исправлений: 1)

Ответ на: комментарий от anonymous

Я тоже думаю что дело здесь. Префикс от IPv4, маска от IPv6.

Demacr ★★
()

192.168.0.0/48

Это божественно. 48 бит в 32-битном адресе. Просто музыка для души.

WereFox ★☆
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.