查看nfs安装的状态

nfs运行成功主要看rpcbind和nfs这一块运行成功:rpcbind可以看如下的命令:


查看rpcbind状态

$ service rpcbind status
Redirecting to /bin/systemctl status rpcbind.service
● rpcbind.service - RPC bind service
   Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2020-02-09 21:04:14 CST; 3 days ago
  Process: 31543 ExecStart=/sbin/rpcbind -w $RPCBIND_ARGS (code=exited, status=0/SUCCESS)
 Main PID: 31544 (rpcbind)
    Tasks: 1
   Memory: 896.0K
   CGroup: /system.slice/rpcbind.service
           └─31544 /sbin/rpcbind -w

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

注意:出现Active: active (running)表示rpcbind运行成功。

上面有一句话:Redirecting to /bin/systemctl status rpcbind.service,这句话表示service rpcbind status实际执行的是/bin/systemctl status rpcbind.service这句指令,所以,我们可以直接使用/bin/systemctl status rpcbind.service指令来查看状态,如下:

$ /bin/systemctl status rpcbind.service | grep Active
Active: active (running) since Sun 2020-02-09 21:04:14 CST; 3 days ago

查看nfs状态

service nfs status来查看nfs的服务器状态。

$ service nfs status
Redirecting to /bin/systemctl status nfs.service
● nfs-server.service - NFS server and services
   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled)
   Active: active (exited) since Sun 2020-02-09 21:04:15 CST; 3 days ago
  Process: 31601 ExecStartPost=/bin/sh -c if systemctl -q is-active gssproxy; then systemctl reload gssproxy ; fi (code=exited, status=0/SUCCESS)
  Process: 31585 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS)
  Process: 31584 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
 Main PID: 31585 (code=exited, status=0/SUCCESS)
    Tasks: 0
   Memory: 0B
   CGroup: /system.slice/nfs-server.service

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

注意:出现Active: active (exited) since Sun 2020-02-09 21:04:15 CST; 3 days ago表示nfs运行成功。

上面有一句话:Redirecting to /bin/systemctl status nfs.service,这句话表示service nfs status实际执行的是/bin/systemctl status nfs.service这句指令,所以,我们可以直接使用/bin/systemctl status nfs.service指令来查看状态,如下:

$ /bin/systemctl status nfs.service | grep Active
Active: active (exited) since Sun 2020-02-09 21:04:15 CST; 3 days ago