Linux: clnt_create: RPC: 程序未注册

Linux: clnt_create: RPC: 程序未注册

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)

答案1

你必须:

[email protected]]$ service nfs status
rpc.svcgssd is stopped
rpc.mountd is stopped
nfsd is stopped
rpc.rquotad is stopped

[email protected]]$ service nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]

[email protected]]$ chkconfig nfs on

答案2

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

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

答案3

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

  1. 安装 nfs-utils 并检查以确保其已安装 ( yum install -y nfs-utils / rpm -qa | grep nfs-utils)
  2. vi /etc/sysconfig/nfs(取消注释并更改以下端口号.. STATD_PORT=、MOUNTD_PORT=、LOCKD_UDPPORT=、LOCKED_TCPPORT={您可以使用 4000-4004 或您选择的任何端口}
  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 [email protected]
  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.

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

答案4

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

问候!!

相关内容