Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3050067
  • 博文数量: 535
  • 博客积分: 15788
  • 博客等级: 上将
  • 技术积分: 6507
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-07 09:11
文章分类

全部博文(535)

文章存档

2016年(1)

2015年(1)

2014年(10)

2013年(26)

2012年(43)

2011年(86)

2010年(76)

2009年(136)

2008年(97)

2007年(59)

分类: LINUX

2009-10-23 10:03:18

之前在EC2上使用rightscale的ami搭建nfs服务时出现下面的错误,造成不能启动nfs服务:
Starting RPC idmapd: FATAL: Module sunrpc not found.
FATAL: Error running install command for sunrpc

使用新的rightscale的AMI可以解决这个问题:
如:
AMI ID:
ami-6d749504
Owner:
411009282317
Product Code:
-
Kernel ID:
aki-a71cf9ce
Visibility:
Public
Architecture:
i386
Ramdisk ID:
ari-a51cf9cc
State:
available
Image Type:
machine
Platform:
Cent OS

Manifest:
rightscale-us/CentOS_5.2_i386_v4.2.4.manifest.xml
内核为:
Linux domU- 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008 i686 i686 i386 GNU/Linux


下面的部分是试图在有问题的AMI上解决这个问题的过程,问题还没有解决~~
查看lsmod|grep sunrpc时没有该模块。

查看/usr/src/linux-2.6.16-xenU/.config
grep SUNRPC .config
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y

因为sunrpc被直接编译到内核里而不是[M](即模块),但是,idmapd服务启动时查找的是sunrpc模块,所以会报找不到sunrpc模块。

解决的办法就是注释掉/etc/init.d/rpcidmapd启动脚本中的监测sunrpc模块是否挂载的部分:

        # Load sunrpc which mounts the rpc_pipes fs.
        [ -x /sbin/lsmod -a -x /sbin/modprobe ] && {
                if ! /sbin/lsmod | grep sunrpc > /dev/null ; then
                         /sbin/modprobe sunrpc || exit 1
                fi
        }
注释掉以后重新启动:
[root@domU-12-31-39-02-41-C1:/usr/src/linux-2.6.16-xenU] service nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
Starting RPC idmapd: Error: RPC MTAB does not exist.

以下摘自:

Description of problem:

If you stop the 'rpcidmapd' service and then do something like 'umount -a', then
it will also umount the rpc_pipefs.

Then when you try to restart 'rpcidmapd' service (or the 'nfs' service which in
turn also starts the 'rpcidmapd' service), you get the error:
    Starting RPC idmapd: Error: RPC MTAB does not exist.

The reason is that the 'rpc_pipefs' filesystem has been unmounted. Now usually
loading the 'sunrpc' module will mount the 'rpc_pipefs'; however, in this case
'sunrpc' is already loaded and therefore not reloaded.

This is a confusing error that is not easy to decipher and solve.
Manually there are two solutions:
1. Unload and reload the 'sunrpc' module (which requires removing the modules
that depend on it and stopping the associated services)
2. Alternatively, mount the filesystem manually
      mount -t rpc_pipefs sunpc /var/lib/nfs/rpc_pipefs

Similarly, if you do 'umount -a' but don't unload the 'nfsd' module, then the
'
nfsd' filesystem will be unmounted and not remounted when you restart the nfs
service. However, in this case, the init script doesn'
t even warn you that the
filesystem is not mounted.
Again, manually you have two options
1. Unload and reload the 'nfsd' module
2. Manually create the filesystem
     mount -t nfsd nfsd /proc/fs/nfsd

However, this is all NON-OBVIOUS and could trip people up (it took me many
wasted hours trying to figure out what is happening here :)

I think a better solution would be to test for the existence of the 'rpc_pipefs'
and 'nfsd' at the end of the init.d scrips starting the 'rpcidmapd' and 'nfs'
services RESPECTIVELY.

Then, if the filesystems are either pre-existing or were just created indirectly
by the loading of the 'sunrpc' and 'nfsd' modules then nothing would be
necessary. However, if the filesystems are not there, then the script would just
run the above 'mount' commands to create the filesystems.


阅读(2361) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~