Linux start nfs-server error

1, the error message when you start nfs-server command with systemctl

    1) system environment:

[root@vms001 /]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.1 (Maipo)
[root@vms001 /]# uname -r
3.10.0-229.el7.x86_64

    2) an error message when you start nfs-server:

[root@vms001 /]# systemctl start nfs-server.service 
Job for nfs-server.service failed. See 'systemctl status nfs-server.service' and 'journalctl -xn' for details.

2, find the cause of an error

       "Based on the above error message alert See 'systemctl Status nfs-server.service '", please refer nfs-server service status information.

       According to error prompt, we enter systemctl status nfs-server nfs-server service to view status information, the code is as follows:

[root@vms001 /]# systemctl status nfs-server.service 

nfs-server.service - NFS server and services

   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled)

   Active: failed (Result: exit-code) since 四 2019-06-20 16:39:47 CST; 7min ago

  Process: 4092 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=1/FAILURE)


6月 20 16:39:47 vms001.example.com systemd[1]: Starting NFS server and services...

6月 20 16:39:47 vms001.example.com exportfs[4092]: exportfs: Failed to stat /xx: No such file or directory

6月 20 16:39:47 vms001.example.com systemd[1]: nfs-server.service: control process exited, code=exited status=1

6月 20 16:39:47 vms001.example.com systemd[1]: Failed to start NFS server and services.

6月 20 16:39:47 vms001.example.com systemd[1]: Unit nfs-server.service entered failed state.

    ③   According View nfs-server state information service, found that more than exportfs: Failed to stat / xx: No such file or directory section (exportfs: stat / xx failed No such file or directory).

       Why is there no prompt / xx such file or directory it? This may be before we configured the shared directory nfs, but we do not have the shared directory, so when we start nfs-server services are being given this prompt. Then take a look at whether we really have configured / xx shared directory, the code is as follows:

[root@vms001 /]# cat /etc/exports
##############################
/xx 192.168.26.0/24(rw,sync)

According to the above code, found in the / etc / exports configuration file which is really a / xx shared directory. Then we look at the creation / xx or delete the directory / etc / exports configuration file inside / xx this share.

3, the solution

    1) create / xx directory

[root@vms001 /]# mkdir /xx

    2) Start nfs-server service again

[root@vms001 /]# systemctl start nfs-server.service

    3) Check nfs-server service status

[root@vms001 /]# systemctl status nfs-server.service 

nfs-server.service - NFS server and services

   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled)

   Active: active (exited) since 四 2019-06-20 16:53:44 CST; 16s ago

  Process: 4594 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS)

  Process: 4592 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)

 Main PID: 4594 (code=exited, status=0/SUCCESS)

   CGroup: /system.slice/nfs-server.service

Results: Based on these results, we have created / xx directory to start again after nfs-server succeeded.

4, summary

    When we start the service error, be sure to carefully review the information to see his error or status information, find no, not, error and other keywords, which helps to enhance their ability to solve problems troubleshooting, you can greatly improve their productivity. Try to figure out their own problems to solve, it is impossible to go online to search.


Guess you like

Origin blog.51cto.com/13716812/2411658