Linux:clnt_create:RPC:程序未注册

use*_*459 26 linux mount

最近 NFS 挂载会自动卸载。当我检查时,NFS 服务状态显示它正在运行。

[root@hsluasrepo]# service nfs status
rpc.svcgssd is stopped
rpc.mountd (pid 4083) is running...
nfsd (pid 4148 4147 4146 4145 4144 4143 4142 4141) is running...
rpc.rquotad (pid 4079) is running...

[root@hsluasrepo]# service rpcbind status
rpcbind (pid  4203) is running...

[root@hsluasrepo common]# rpcinfo -p 10.80.3.154
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
Run Code Online (Sandbox Code Playgroud)

但是showmount输出显示错误。

[root@hsluasrepo ]# showmount -e 10.80.3.154
clnt_create: RPC: Program not registered
Run Code Online (Sandbox Code Playgroud)

重新启动 NFS 服务后,showmount输出显示 NFS 服务器的导出列表。

谁能告诉我这个问题的根本原因以及将来如何避免这个问题?

/var/log/messages

Jul 7 03:22:01 hsluasrepo rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="1188" x-info="rsyslog.com"] rsyslogd was HUPed
Jul 7 03:22:02 hsluasrepo rhsmd: In order for Subscription Manager to provide your system with updates, your system must be registered with RHN. Please enter your Red Hat login to ensure your system is up-to-date.
Jul 8 03:22:01 hsluasrepo rhsmd: In order for Subscription Manager to provide your system with updates, your system must be registered with RHN. Please enter your Red Hat login to ensure your system is up-to-date.
Jul 8 16:36:55 hsluasrepo kernel: nfsd: last server has exited, flushing export cache
Jul 8 16:36:55 hsluasrepo rpc.mountd[4083]: Caught signal 15, un-registering and exiting.
Jul 8 16:36:55 hsluasrepo rpc.mountd[24463]: Version 1.2.3 starting
Jul 8 16:36:55 hsluasrepo kernel: NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
Jul 8 16:36:55 hsluasrepo kernel: NFSD: starting 90-second grace period
Jul 8 16:37:32 hsluasrepo rpc.mountd[24463]: authenticated mount request from 10.60.5.208:1004 for /common/PROD (/common/PROD)
Jul 8 16:38:09 hsluasrepo rpc.mountd[24463]: authenticated mount request from 10.60.5.181:869 for /common/PROD (/common/PROD) 
Jul 8 16:38:43 hsluasrepo rpc.mountd[24463]: authenticated mount request from 10.60.5.180:825 for /common/PROD (/common/PROD)
Jul 8 16:39:12 hsluasrepo rpc.mountd[24463]: authenticated mount request from 10.60.5.176:688 for /common/PROD (/common/PROD)
Run Code Online (Sandbox Code Playgroud)

小智 12

你必须:

root@10.80.3.154]$ service nfs status
rpc.svcgssd is stopped
rpc.mountd is stopped
nfsd is stopped
rpc.rquotad is stopped

root@10.80.3.154]$ service nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]

root@10.80.3.154]$ chkconfig nfs on
Run Code Online (Sandbox Code Playgroud)

  • `服务状态nfs`? (2认同)

小智 5

我在 RHEL6 上遇到过这个问题。很奇怪,但是service rpcbind restart在 nfs 服务之前运行会使错误消失。我跟着这篇文章:在 RHEL6 中逐步配置 NFS 服务器

这对我有用,但我仍然想知道背后的原因。谁能解释一下?

  • 如果你把一个问题和你的答案放在一起,很少有人会看到它。把最后一句话去掉,变成一个新问题(参考这个问答作为解决方案,而不是解释)。 (3认同)