ceph 接入OpenStack
创建对应的pool:
ceph osd pool create volumes 512
ceph osd pool create images 512
ceph osd pool create vms 512
安装各个节点需要的组件:
在Controller节点安装ceph管理接口:
sudo apt-get install python-ceph libvirt-bin
在Glance节点安装python-rbd:
sudo apt-get install python-rbd
在Cinder-volume节点和Nova-compute节点安装ceph-common:
sudo apt-get install ceph-common
复制Ceph配置文件到各个节点
Glance节点、Cinder-volume节点和Nova-compute节点:
ssh (your-openstack-server-node) sudo tee /etc/ceph/ceph.conf </etc/ceph/ceph.conf
创建CephX认证授权用户:
ceph auth get-or-create client.cinder mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=volumes, allow rwx pool=vms, allow rx pool=images'
ceph auth get-or-create client.glance mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=images'
复制秘钥
把密钥环复制到Glance节点、Cinder-volume节点、Nova-compute节点以及Cinder-Backup节点并且授权:
ceph auth get-or-create client.glance | ssh {your-glance-api-server} sudo tee /etc/ceph/ceph.client.glance.keyring
ssh {your-glance-api-server} sudo chown glance:glance /etc/ceph/ceph.client.glance.keyring
ceph auth get-or-create client.cinder | ssh {your-volume-server} sudo tee /etc/ceph/ceph.client.cinder.keyring
ssh {your-cinder-volume-server} sudo chown cinder:cinder /etc/ceph/ceph.client.cinder.keyring
ceph auth get-or-create client.cinder | ssh {your-nova-compute-server} sudo tee /etc/ceph/ceph.client.cinder.keyring
#还得把 client.cinder 用户的密钥存进 libvirt,libvirt 进程从 Cinder 挂载块设备时要用它访问集群
ceph auth get-key client.cinder | ssh {your-compute-node} tee client.cinder.key
配置Glance节点
在glance-api配置文件中修改以下内容:
[glance_store]
default_store = rbd
show_image_direct_url = True
stores = rbd
rbd_store_pool = images
rbd_store_user = glance
ceph_conf = /etc/ceph/ceph.conf
rbd_store_chunk_size = 8
配置cinder-volume节点
添加以下内容:
[DEFAULT]
enabled_backends = ceph
[ceph]
volume_driver = cinder.volume.drivers.rbd.RBDDriver
rbd_pool = volumes
rbd_ceph_conf = /etc/ceph/ceph.conf
rbd_flatten_volume_from_snapshot = false
rbd_max_clone_depth = 5
rbd_store_chunk_size = 4
rados_connect_timeout = -1
glance_api_version = 2
rbd_user = cinder
rbd_secret_uuid = 457eb676-33da-42ec-9a8c-9293d545c337
配置nova-compute节点
创建secret.xml并且把密钥注入到Libvirt里面:
cat > secret.xml <<EOF
<secret ephemeral='no' private='no'>
<uuid>457eb676-33da-42ec-9a8c-9293d545c337</uuid>
<usage type='ceph'>
<name>client.cinder secret</name>
</usage>
</secret>
EOF
sudo virsh secret-define --file secret.xml
sudo virsh secret-set-value --secret 457eb676-33da-42ec-9a8c-9293d545c337 --base64 $(cat client.cinder.key)
rm client.cinder.key secret.xml
编辑nova-compute配置文件
添加以下内容:
[libvirt]
images_type= rbd
images_rbd_pool= vms
images_rbd_ceph_conf= /etc/ceph/ceph.conf
rbd_user= cinder
rbd_secret_uuid= 457eb676-33da-42ec-9a8c-9293d545c337
inject_password = false
inject_key = false
inject_partition = -2
block_migration_flag = VIR_MIGRATE_UNDEFINE_SOURCE, VIR_MIGRATE_PEER2PEER, VIR_MIGRATE_LIVE, VIR_MIGRATE_TUNNELLED, VIR_MIGRATE_NON_SHARED_INC, VIR_MIGRATE_PERSIST_DEST
live_migration_bandwidth = 0
live_migration_flag = VIR_MIGRATE_UNDEFINE_SOURCE, VIR_MIGRATE_PEER2PEER, VIR_MIGRATE_LIVE, VIR_MIGRATE_TUNNELLED, VIR_MIGRATE_PERSIST_DEST, VIR_MIGRATE_PERSIST_DEST
libvirt_live_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST"
live_migration_uri = qemu+tcp://%s/system
hw_disk_discard = unmap
disk_cachemodes = "network=writeback"
cpu_mode = host-passthrough
重启服务
sudo service glance-api restart
sudo service nova-compute restart
sudo service cinder-volume restart
ceph 接入OpenStack的更多相关文章
- “CEPH浅析”系列之六——CEPH与OPENSTACK
在 <"Ceph浅析"系列之二--Ceph概况>中即已提到,关注Ceph的原因之一,就是OpenStack社区对于Ceph的重视.因此,本文将对Ceph在OpenSta ...
- Ceph在OpenStack中的地位
对Ceph在OpenStack中的价值进行简要介绍,并且对Ceph和Swift进行对比. 对于一个IaaS系统,涉及到存储的部分主要是块存储服务模块.对象存储服务模块.镜像管理模块和计算服务模块.具体 ...
- Ceph与OpenStack整合(仅为云主机提供云盘功能)
1. Ceph与OpenStack整合(仅为云主机提供云盘功能) 创建: linhaifeng,最新修改: 大约1分钟以前 ceph ceph osd pool create volumes 128 ...
- ceph对接openstack环境(4)
ceph对接openstack环境 环境准备: 保证openstack节点的hosts文件里有ceph集群的各个主机名,也要保证ceph集群节点有openstack节点的各个主机名 一.使用rbd方式 ...
- VMware 接入 Openstack — 使用 Openstack 创建 vCenter 虚拟机
目录 目录 软件环境 前言 Openstack 接口驱动 使用 KVM 在 Compute Node 上创建虚拟机的流程 使用 VCDirver 在 vCenter 上创建虚拟机的流程 配置 vCen ...
- The Dos and Don'ts for Ceph for OpenStack
Ceph和OpenStack是一个非常有用和非常受欢迎的组合. 不过,部署Ceph / OpenStack经常会有一些容易避免的缺点 - 我们将帮助你解决它们 使用 show_image_direct ...
- ceph与openstack对接
对接分为三种,也就是存储为openstack提供的三类功能1.云盘,就好比我们新加的硬盘2.原本的镜像也放在ceph里,但是我没有选择这种方式,原因是因为后期有要求,但是我会把这个也写出来,大家自己对 ...
- Ceph与OpenStack的Nova相结合
https://ervikrant06.wordpress.com/2015/10/24/how-to-configure-ceph-as-nova-compute-backend/ 在Ceph的ad ...
- Ceph与OpenStack的Glance相结合
http://docs.ceph.com/docs/master/rbd/rbd-openstack/?highlight=nova#kilo 在Ceoh的admin-node上进行如下操作: 1. ...
随机推荐
- EOS 数据库RAM使用量的计算
如果你是EOS的合约开发者,相信你很有可能跟我一样对内存(RAM)的使用量感到不解.在使用multi_index进行数据存储时,明明只存了一点数据,但区块链浏览器中显示的内存占用量却上升了不少.在这篇 ...
- java开源工具包-Jodd框架
java开源工具包-Jodd框架 / 2019-07-24 Jodd是一个Java工具包和微型框架,Jodd 工具包含一些实用的工具类和小型框架,增强了 JDK 提供很多强大的功能,可以帮助实现 ...
- C# redis客户端帮助类
需要在NuGet里面引用ServiceStack.Redis using ServiceStack.Redis; using ServiceStack.Redis.Generic; using Sys ...
- 持久化机器学习模型(joblib方式)
import numpy as np import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression ...
- [LeetCode] 200. Number of Islands 岛屿的数量
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surro ...
- [LeetCode] 803. Bricks Falling When Hit 打击砖块掉落
We have a grid of 1s and 0s; the 1s in a cell represent bricks. A brick will not drop if and only i ...
- Quartz学习笔记:基础知识
Quartz学习笔记:基础知识 引入Quartz 关于任务调度 关于任务调度,Java.util.Timer是最简单的一种实现任务调度的方法,简单的使用如下: import java.util.Tim ...
- FPGA的配置方式
FPGA的配置方式 FPGA的配置方式有以下几种,JTAG,AS,PS,AP,FPP等几种. JTAG模式.JTAG模式下将.sof文件下载到FPGA内部的RAM内部进行运行,掉电程序丢失,主要用于前 ...
- C++中print和printf的区别
print与printf的区别 1,print 中不能使用%s ,%d 或%c: 2,print 自动换行,printf 没有自动换行.
- Appium元素定位难点:混合式的native+webview
现在大部分app都是混合式的native+webview,对应native上的元素通过uiautomatorviewer很容易定位到,webview上的元素就无法识别了. 1.认识识webview & ...