你好,游客 登录 注册 搜索
背景:
阅读新闻

Openstack对接Ceph时的错误

[日期:2017-08-09] 来源:Linux社区  作者:shyln [字体: ]

本次 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。
[root@compute01 ~]# qemu-img --help | grep rbd
[root@compute01 ~]#

注此时我已经装了ceph相关的包现在已经有了rbd的命令内核已经也已经有了rbd现在是qemu不支持rbd协议接下来继续证明这个事情

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

可以看到直接让qemu使用ceph都不行报不支持rbd协议此时 我回想自己编译qemu时是默认选项查了好多文档默认是不支持rbd的所以要重新编译此次开启rbd
[root@compute01 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++我们来安装包
[root@compute01 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!

再次编译
[root@compute01 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我们继续装包
[root@compute01 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!

再次编译
[root@compute01 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
 
[root@compute01 qemu-2.9.0]# make && make install

大概等了3个小时终于编译完成!
install -c -m 0755 qemu-tilegx  "/usr/local/bin"
strip "/usr/local/bin/qemu-tilegx"
install -d -m 0755 "/usr/local/bin"
install -c -m 0755 qemu-x86_64  "/usr/local/bin"
strip "/usr/local/bin/qemu-x86_64"
[root@compute01 qemu-2.9.0]#

再次查看是否支持rbd
[root@compute01 ~]# qemu-img -h|grep rbd
Supported formats: blkdebug blkreplay blkverify bochs cloop dmg file host_cdrom host_device luks nbd null-aio null-co parallels qcow qcow2 qed quorum raw rbd replication sheepdog vdi vhdx vmdk vpc vvfat
[root@compute01 ~]#

qemu已经支持rbd了!此次任务完成!

更多Ceph相关教程见以下内容

CentOS 7.1 上安装分布式存储系统 Ceph  http://www.linuxidc.com/Linux/2015-08/120990.htm

Ceph环境配置文档 PDF http://www.linuxidc.com/Linux/2013-05/85212.htm 

CentOS7下部署Ceph集群(版本10.2.2) http://www.linuxidc.com/Linux/2017-02/140728.htm

Ceph的安装过程 http://www.linuxidc.com/Linux/2013-05/85210.htm 

如何升级Ceph版本及注意事项  http://www.linuxidc.com/Linux/2017-02/140631.htm

HOWTO Install Ceph On FC12, FC上安装Ceph分布式文件系统 http://www.linuxidc.com/Linux/2013-05/85209.htm 

实验环境Ceph 9.2.1部署笔记 http://www.linuxidc.com/Linux/2016-11/137094.htm

Ubuntu 16.04快速安装Ceph集群  http://www.linuxidc.com/Linux/2016-09/135261.htm

CentOS 7下单台物理机搭建Ceph集群  http://www.linuxidc.com/Linux/2017-06/144636.htm

Ceph 的详细介绍请点这里
Ceph 的下载地址请点这里

本文永久更新链接地址http://www.linuxidc.com/Linux/2017-08/146127.htm

linux
本文评论   查看全部评论 (0)
表��: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款