Linux:clnt_create:RPC:程序未注册


22

最近自动卸载了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

但是showmount输出显示错误。

[root@hsluasrepo ]# showmount -e 10.80.3.154
clnt_create: RPC: Program not registered

重新启动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)

我会检查我的dmesg日志和/ var / log / syslog或/ var / log / messages,以查看是否有迹象表明NFS服务引发了任何错误。另外,NFS共享所包含的磁盘是否在任何形式的RAID中?如果RAID成员失败,则共享可能已进入不可用状态。
slm

检查nfs deamon是否在导出共享的nfs服务器上运行

由于这确实是太荒谬的错误消息,因此我要求在bugzilla.kernel.org/show_bug.cgi?id=152151处进行澄清。也许有一天我们会知道它实际上意味着什么。
里希

Answers:


10

你必须:

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

1
service status nfs
迪伦

5

我在RHEL6上遇到了这个问题。它很奇怪,但是在nfs服务和错误消失之前重新启动了rpcbind服务。我按照本文 在RHEL6中逐步配置NFS服务器。 它对我有用,但我仍然想知道背后的原因。还有其他人背后的原因吗?


3
如果您将一个问题与一个答案一起提出,很少有人会看到它。删除最后一句话,将其变成一个新问题(请参阅此问答作为解决方案,而不是解释)。
Anthon 2014年

@rohit-确实解决了问题。RPCBIND服务在NFS服务之前重新启动。
anup

3

我遇到了这个问题,我使用一种简单的方法来解决它,涉及nfs服务器和客户端配置,涉及到10个步骤。

  1. 安装nfs-utils并检查以确保已安装(yum install -y nfs-utils / rpm -qa | grep nfs-utils
  2. vi /etc/sysconfig/nfs (取消注释,并更改以下端口号。
  3. system-config-firewall-tui {打开上面2中指定的端口号以及111(rpc)和2049(nfs)}
  4. iptables save
  5. vi /etc/export (提供要共享的目录以及共享目录以及选项,例如。 /share *(ro,async)
  6. exportfs -rv
  7. service nfs start
  8. ssh root@clientserver。例如。ssh root@192.168.2.15
  9. showmount -e {master ip} 例如。 showmount -e 192.168.2.31
  10. mount -t nfs {master ip}:/{shared dir from master} /{mount point} ..例如 mount -t nfs 192.168.2.31:/share /mnt

最后,执行df -h

这只是我的一点贡献;我可能未采取所有必要步骤,但这可能会有所帮助。


0

我最近在虚拟机上的RHEL中配置了NFS,并且当我设置showmount -e localhost命令时出现相同的问题。尝试重新启动服务几次后,我刚刚关闭了虚拟机的电源并再次打开电源,问题已解决。

问候!!

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.