Unable to start the nfs-server.service because unable to resolve hostname

Solution Unverified - Updated -

Environment

  • RHEL 7.2
  • libnfsidmap-0.25-12.el7.x86_64
  • nfs-utils-1.3.0-0.18.el7.x86_64

Issue

  • Starting the NFS service we get the following error message, when one of the client is down or DNS is unable to resolve a
    hostname
# systemctl restart nfs.service 
Job for nfs-server.service failed because the control process exited with error code. See "systemctl status nfs-server.service" and "journalctl -xe" for details.

Resolution

Diagnostic Steps

As shown below it is failing as it is unable to resolve foobar.com

# systemctl status nfs-server.service
● nfs-server.service - NFS server and services
   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2015-12-04 09:56:08 IST; 8s ago
  Process: 21370 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS)
  Process: 21366 ExecStopPost=/usr/sbin/exportfs -au (code=exited, status=0/SUCCESS)
  Process: 21362 ExecStop=/usr/sbin/rpc.nfsd 0 (code=exited, status=0/SUCCESS)
  Process: 21273 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS)
  Process: 2714 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=1/FAILURE)
 Main PID: 21273 (code=exited, status=0/SUCCESS)

Dec 04 09:56:07 srv1-rhel7.example.com systemd[1]: Starting NFS server and services...
Dec 04 09:56:08 srv1-rhel7.example.com exportfs[2714]: exportfs: Failed to resolve foobar.com <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Dec 04 09:56:08 srv1-rhel7.example.com exportfs[2714]: exportfs: Failed to resolve foobar.com <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Dec 04 09:56:08 srv1-rhel7.example.com systemd[1]: nfs-server.service: control process exited, code=exited status=1
Dec 04 09:56:08 srv1-rhel7.example.com systemd[1]: Failed to start NFS server and services.
Dec 04 09:56:08 srv1-rhel7.example.com systemd[1]: Unit nfs-server.service entered failed state.
Dec 04 09:56:08 srv1-rhel7.example.com systemd[1]: nfs-server.service failed.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments