Ceph启动失败: ImportError: No module named rados

crasylph 发布于 2014/04/28 21:14
阅读 7K+
收藏 0

解读下一代网络:算力网络正从理想照进现实!>>>

三台机器,每台兼任mds和osd,其中一台兼任mon,初始化成功(倒腾了一整天。。。)

然后启动的时候失败,信息如下。。。

# /etc/init.d/ceph -a start
=== mon.00 === 
Starting Ceph mon.00 on ceph00...already running
=== mds.00 === 
Starting Ceph mds.00 on ceph00...already running
=== mds.01 === 
Starting Ceph mds.01 on ceph01...already running
=== mds.02 === 
Starting Ceph mds.02 on ceph02...already running
=== osd.00 === 
Mounting Btrfs on ceph00:/data/osd.00
Scanning for Btrfs filesystems
Traceback (most recent call last):
  File "/usr/local/ceph/bin/ceph", line 56, in <module>
    import rados
ImportError: No module named rados
failed: 'timeout 10 /usr/local/ceph/bin/ceph --name=osd.00 --keyring=/data/osd.00/keyring osd crush create-or-move -- 00 0.02 root=default host=ceph00 '
root@ceph00:~/.ssh# /etc/init.d/ceph -a start
=== mon.00 === 
Starting Ceph mon.00 on ceph00...already running
=== mds.00 === 
Starting Ceph mds.00 on ceph00...already running
=== mds.01 === 
Starting Ceph mds.01 on ceph01...already running
=== mds.02 === 
Starting Ceph mds.02 on ceph02...already running
=== osd.00 === 
Mounting Btrfs on ceph00:/data/osd.00
Scanning for Btrfs filesystems
Traceback (most recent call last):
  File "/usr/local/ceph/bin/ceph", line 56, in <module>
    import rados
ImportError: No module named rados
failed: 'timeout 10 /usr/local/ceph/bin/ceph --name=osd.00 --keyring=/data/osd.00/keyring osd crush create-or-move -- 00 0.02 root=default host=ceph00 '


我是用ceph源码编译安装的,我用lsmod命令查看也确实没有rados模块,但是又查不到怎么安装rados模块。。

求助。。。


@oscfox @zetrov 搜的时候搜到你们的提问,看到你们搞定了,请问对我这问题有什么头绪吗。。

加载中
0
crasylph
crasylph


解决方案:将源码包里的src/pybind/*.py复制到ceph/bin下并执行。

解决完以后出现新错误

# /etc/init.d/ceph start osd.00
=== osd.00 === 
Mounting Btrfs on ceph00:/data/osd.00
Scanning for Btrfs filesystems
Traceback (most recent call last):
  File "/usr/local/ceph/bin/ceph", line 823, in <module>
    sys.exit(main())
  File "/usr/local/ceph/bin/ceph", line 590, in main
    conffile=conffile)
  File "/usr/local/ceph/bin/rados.py", line 197, in __init__
    self.librados = CDLL('librados.so.2')
  File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: librados.so.2: cannot open shared object file: No such file or directory
failed: 'timeout 10 /usr/local/ceph/bin/ceph --name=osd.00 --keyring=/data/osd.00/keyring osd crush create-or-move -- 00 0.02 root=default host=ceph00 '



将使用ldconfig添加ceph/lib路径解决,又出现以下问题

# /etc/init.d/ceph -a start
=== mon.00 === 
Starting Ceph mon.00 on ceph00...
=== mds.00 === 
Starting Ceph mds.00 on ceph00...already running
=== mds.01 === 
Starting Ceph mds.01 on ceph01...already running
=== mds.02 === 
Starting Ceph mds.02 on ceph02...already running
=== osd.00 === 
Mounting Btrfs on ceph00:/data/osd.00
Scanning for Btrfs filesystems
Error connecting to cluster: ObjectNotFound
2014-04-29 09:20:59.817164 7ff066215700 -1 monclient(hunting): ERROR: missing keyring, cannot use cephx for authentication
2014-04-29 09:20:59.817181 7ff066215700  0 librados: osd.00 initialization error (2) No such file or directory
failed: 'timeout 10 /usr/local/ceph/bin/ceph --name=osd.00 --keyring=/data/osd.00/keyring osd crush create-or-move -- 00 0.02 root=default host=ceph00 '



找不到keyring的原因是ceph -a -start的时候不知道为什么把keyring删掉了,解决方案是mkcephfs之后先备份osd.00文件夹,ceph -a start以后把keyring还原回去,就可以运行了,然后是这个错误。。。


# /etc/init.d/ceph  start osd.00
=== osd.00 === 
Mounting Btrfs on ceph00:/data/osd.00
Scanning for Btrfs filesystems
2014-04-29 13:38:31.207944 7f442c754700  0 -- :/1010297 >> 114.212.81.91:6789/0 pipe(0x7f442800e3e0 sd=4 :0 s=1 pgs=0 cs=0 l=1 c=0x7f442800e640).fault
2014-04-29 13:38:34.206985 7f442c653700  0 -- :/1010297 >> 114.212.81.91:6789/0 pipe(0x7f441c000c00 sd=4 :0 s=1 pgs=0 cs=0 l=1 c=0x7f441c000e60).fault
2014-04-29 13:38:37.207758 7f442c754700  0 -- :/1010297 >> 114.212.81.91:6789/0 pipe(0x7f441c003010 sd=4 :0 s=1 pgs=0 cs=0 l=1 c=0x7f441c003270).fault
2014-04-29 13:38:40.208294 7f442c653700  0 -- :/1010297 >> 114.212.81.91:6789/0 pipe(0x7f441c0039c0 sd=4 :0 s=1 pgs=0 cs=0 l=1 c=0x7f441c003c20).fault
failed: 'timeout 10 /usr/local/ceph/bin/ceph --name=osd.00 --keyring=/data/osd.00/keyring osd crush create-or-move -- 00 0.02 root=default host=ceph00 '



网络连接出错。。我osd.00和mon.00是在一台机器上的,怎么会连不上呢。。

crasylph
crasylph
解决方案,在ceph.conf的osd段添加keyring,重新mkcephfs
0
王明帅
王明帅
应该是ceph或者ceph-deploy的依赖装到了python2.6中,而系统用的是python2.7,求问怎么解决,除了直接用python2.6
0
guyson
guyson
添加python环境变量:PYTHONPATH。
返回顶部
顶部