1. 程式人生 > >Openstack對接Ceph時的錯誤

Openstack對接Ceph時的錯誤

openstack

本次 Openstack 版本為N版ceph版本為J版在對接volume和glance時非常輕松不過在對接nova的時候坑了一下午。

ERROR nova.compute.manager [instance: b6b53548-2d12-4019-a189-1d006455dfa3] 2017-08-07T14:09:55.209454Z qemu-system-x86_64: -drive file=rbd:vms/b6b53548-2d12-4019-a189-1d006455dfa3_disk:id=cinder:auth_supported=cephx\;none:mon_host=192.168.0.151\:6789,file.password-secret=virtio-disk0-secret0,format=raw,if=none,id=drive-virtio-disk0,cache=none: Unknown protocol ‘rbd‘

意思是說不支持rbd協議 於是乎查看自己的qemu。我的qemu是編譯安裝的詳情見

http://home.51cto.com/space/6890594

[[email protected] ~]# qemu-img --help | grep rbd
[[email protected] ~]#

註此時我已經裝了ceph相關的包現在已經有了rbd的命令內核已經也已經有了rbd現在是qemu不支持rbd協議接下來繼續證明這個事情

[[email protected] ~]# rados lspools
glance
volumes
vms
rbd
images
[[email protected]
/* */ ~]# rbd ls volumes volume-4a898a0e-40db-4846-b944-079891598ae4 [[email protected] ~]# [[email protected] ~]# qemu-img create -f raw rbd:volumes/test 5G qemu-img: rbd:volumes/test: Unknown protocol ‘rbd‘ [[email protected] ~]#

可以看到直接讓qemu使用ceph都不行報不支持rbd協議此時 我回想自己編譯qemu時是默認選項查了好多文檔默認是不支持rbd的所以要重新編譯此次開啟rbd

[[email protected] qemu-2.9.0]# ./configure --enable-rbd
No C++ compiler available; disabling C++ specific optional code

ERROR: User requested feature rados block device
       configure was not able to find it.
       Install librbd/ceph devel

報No C++我們來安裝包

[[email protected] qemu-2.9.0]# yum install gcc  gcc-c++ 
Installed:
  gcc-c++.x86_64 0:4.8.5-11.el7                                                                                            

Dependency Installed:
  libstdc++-devel.x86_64 0:4.8.5-11.el7                                                                                    

Complete!

再次編譯

[[email protected] qemu-2.9.0]# ./configure --enable-rbd

ERROR: User requested feature rados block device
       configure was not able to find it.
       Install librbd/ceph devel

報找不到ceph 的librdb我們繼續裝包

[[email protected] qemu-2.9.0]# yum install ceph-devel
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package ceph-devel-compat.x86_64 1:10.2.9-0.el7 will be installed
Installed:
  ceph-devel-compat.x86_64 1:10.2.9-0.el7                                                                                  

Dependency Installed:
  libcephfs1-devel.x86_64 1:10.2.9-0.el7                          libcephfs_jni1.x86_64 1:10.2.9-0.el7                    
  libcephfs_jni1-devel.x86_64 1:10.2.9-0.el7                      librados2-devel.x86_64 1:10.2.9-0.el7                   
  libradosstriper1-devel.x86_64 1:10.2.9-0.el7                    librbd1-devel.x86_64 1:10.2.9-0.el7                     

Complete!

再次編譯

[[email protected] qemu-2.9.0]# ./configure --enable-rbd
Install prefix    /usr/local
BIOS directory    /usr/local/share/qemu
binary directory  /usr/local/bin
library directory /usr/local/lib
module directory  /usr/local/lib/qemu
libexec directory /usr/local/libexec
include directory /usr/local/include
config directory  /usr/local/etc
local state directory   /usr/local/var
Manual directory  /usr/local/share/man
ELF interp prefix /usr/gnemul/qemu-%M

rbd support       yes ###重點來了
NUMA host support no
tcmalloc support  no
jemalloc support  no
avx2 optimization yes
replication support yes

[[email protected] qemu-2.9.0]# make && make install



參考文檔

http://www.voidcn.com/blog/xiangpingli/article/p-6087550.html

http://docs.ceph.com/docs/jewel/rbd/qemu-rbd/


本文出自 “完美世界!” 博客,請務必保留此出處http://shyln.blog.51cto.com/6890594/1954346

Openstack對接Ceph時的錯誤