首页 > 其他分享 >Openstack 与 Ceph集群搭建(完结): 配置Ceph作为Openstack后端存储

Openstack 与 Ceph集群搭建(完结): 配置Ceph作为Openstack后端存储

时间:2024-08-27 16:21:42浏览次数:11  
标签:ceph keyring nova Ceph 完结 cinder Openstack glance pool

文章目录

参考文章

Openstack 官方对接ceph文档
Openstack 与 Ceph集群搭建(上): 规划与准备
Openstack 与 Ceph集群搭建(中): Ceph部署
Openstack 与 Ceph集群搭建(下): Openstack部署
Openstack 与 Ceph集群搭建(完结): 配置Ceph作为Openstack后端存储

1. 前置任务

1.0 修改Openstack配置文件

/etc/kolla/globals.yml,该文件定义OpenStack所需要安装的服务。



kolla_base_distro: "ubuntu"

kolla_internal_vip_address: "172.16.250.253"

network_interface: "vlan1250"

neutron_external_interface: "bond0"


enable_haproxy: "yes"
enable_cinder: "yes"
enable_cinder_backup: "yes"
enable_neutron_vpnaas: "yes"
enable_neutron_sriov: "no"
enable_neutron_dvr: "yes"
enable_neutron_fwaas: "yes"
enable_neutron_qos: "yes"
enable_neutron_agent_ha: "yes"
enable_neutron_bgp_dragent: "yes"
enable_neutron_provider_networks: "yes"
enable_neutron_trunk: "yes"
enable_neutron_port_forwarding: "yes"
enable_skyline: "yes"


# Glance
ceph_glance_user: "glance"
ceph_glance_keyring: "client.{{ ceph_glance_user }}.keyring"
ceph_glance_pool_name: "glance-images"
# Cinder
ceph_cinder_user: "cinder"
ceph_cinder_keyring: "client.{{ ceph_cinder_user }}.keyring"
ceph_cinder_pool_name: "cinder-volumes"
ceph_cinder_backup_user: "cinder-backup"
ceph_cinder_backup_keyring: "client.{{ ceph_cinder_backup_user }}.keyring"
ceph_cinder_backup_pool_name: "cinder-backups"
# Nova
ceph_nova_keyring: "{{ ceph_cinder_keyring }}"
ceph_nova_user: "{{ ceph_cinder_user }}"
ceph_nova_pool_name: "nova-vms"

glance_backend_ceph: "yes"

cinder_backend_ceph: "yes"

cinder_volume_group: "cinder-volumes"

cinder_backup_driver: "ceph"

nova_backend_ceph: "yes"

nova_compute_virt_type: "kvm"

1.1. 完成搭建的Ceph集群

请参考Openstack 与 Ceph集群搭建(中): Ceph部署

1.2. 完成存储pool的创建

ceph osd pool create glance-images 300
ceph osd pool create cinder-backups 300
ceph osd pool create cinder-volumes 300
ceph osd pool create nova-vms 300
rbd pool init glance-images
rbd pool init cinder-backups
rbd pool init cinder-volumes
rbd pool init nova-vms

在这里插入图片描述

1.3. 针对OpenStack服务提供的Ceph keyring

keyring是给Openstack各服务用来访问存储使用的。生成keyring方式是在ceph管理节点执行以下操作。

注意:以下命令请保证pool名称与前面创建的名称一致

1.3.1. 生成glance的keyring
ceph auth get-or-create client.glance mon 'allow rwx' osd 'allow class-read object_prefix rbd_children, allow rwx pool=glance-images' 

在这里插入图片描述

1.3.2. 生成Cinder的keyring
ceph auth get-or-create client.cinder mon 'allow rwx' osd 'allow class-read object_prefix rbd_children, allow rwx pool=cinder-volumes, allow rwx pool=nova-vms ,allow rwx pool=glance-images'

在这里插入图片描述

1.3.3. 生成Cinder-backup的Keyring
ceph auth get-or-create client.cinder-backup mon 'allow rwx' osd 'allow class-read object_prefix rbd_children, allow rwx pool=cinder-backups' 

在这里插入图片描述

1.3.4. 生成Nova的keyring
ceph auth get-or-create client.nova mon 'allow rwx' osd 'allow class-read object_prefix rbd_children, allow rwx pool=nova-vms'  

在这里插入图片描述

2. Glance对接Ceph

2.1 编辑globals.yml文件

glance_backend_ceph: "yes"
# Glance
ceph_glance_keyring: "ceph.client.glance.keyring"
ceph_glance_user: "glance"
ceph_glance_pool_name: "glance-images"

2.2 复制ceph.conf文件

创建文件夹

mkdir -p /etc/kolla/config/glance

将ceph控制节点上的配置文件/etc/ceph/ceph.conf复制到etc/kolla/config/glance/ceph.conf

[global]
        fsid = 37bdf718-428b-11ef-90f7-ef5ebd5ff9ae
        mon_host = 10.148.250.250,10.148.250.249,10.148.250.248                                  

注意:在上述存储配置中,自动生成的配置文件mon_host可能还有其他参数,手动修改为纯IP即可。

2.3 复制keyring文件

将前置任务中针对glance生成的keyring文件复制到/etc/kolla/config/glance/ceph.client.glance.keyring

2.4 修改glance配置文件

编辑或新增/etc/kolla/config/glance.conf

[GLOBAL]
show_image_direct_url = True

警告:show_image_direct_url can present a security risk if using more than just Ceph as Glance backend(s). Please see Glance show_image_direct_url

2.5 查看

在这里插入图片描述

3. Cinder对接Ceph

3.1 调整multinode文件配置

当使用外部存储时Openstack无需存储节点,但是Kolla-ansible有[storage]组,为了保证部署openstack不报错,需要设置control为[storage]成员,如下:

编辑multinode文件

[storage]
node-03

3.2 编辑globals.yml文件

cinder_backend_ceph: "yes"
# Cinder
ceph_cinder_keyring: "ceph.client.cinder.keyring"
ceph_cinder_user: "cinder"
ceph_cinder_pool_name: "cinder-volumes"
ceph_cinder_backup_keyring: "ceph.client.cinder-backup.keyring"
ceph_cinder_backup_user: "cinder-backup"
ceph_cinder_backup_pool_name: "cinder-backups"

3.3 复制cepf.conf文件

与Glance保持一致:将ceph控制节点上的配置文件复制到etc/kolla/config/cinder/ceph.conf

mkdir -p /etc/kolla/config/cinder/
mkdir -p /etc/kolla/config/cinder/cinder-volume
mkdir -p /etc/kolla/config/cinder/cinder-backup

3.4 复制keyring文件

复制置任务中针对Cinder生成的keyring,因为是从存储节点复制文件到OpenStack部署节点,故自行操作,目标路径如下:

/etc/kolla/config/cinder/cinder-volume/ceph.client.cinder.keyring

/etc/kolla/config/cinder/cinder-backup/ceph.client.cinder.keyring

/etc/kolla/config/cinder/cinder-backup/ceph.client.cinder-backup.keyring

注意:cinder-backup文件夹需要复制两个keyring,分别是cinder-backup.keyring、cinder.keyring

3.5 nova关联配置

因cinder配置后端ceph存储,那么nova也必须可以访问cinder volumes,编辑globals.yml文件。

ceph_nova_keyring: "{{ ceph_cinder_keyring }}"

复制ceph.client.cinder.keyring文件到/etc/kolla/config/nova/ceph.client.cinder-backup.keyring

如果没有/etc/kolla/config/nova/文件夹,新建即可。

3.6 zun关联配置

由于zun非必要组件,此处忽略。

3.7 查看

在这里插入图片描述

4. Nova对接Ceph

4.1 编辑globals.yml 文件

nova_backend_ceph: "yes"

# Nova
ceph_nova_keyring: "{{ ceph_cinder_keyring }}"
ceph_nova_user: "{{ ceph_cinder_user }}"
ceph_nova_pool_name: "nova-vms"

4.2 复制ceph.conf文件

将ceph控制节点上的配置文件复制到`etc/kolla/config/nova

4.3 复制keyring

复制置任务中针对nova生成的keyring,因为是从存储节点复制文件到OpenStack部署节点,故自行操作,目标路径如下:

/etc/kolla/config/nova/ceph.client.nova.keyring

5. 配置生效

kolla-ansible -i /etc/kolla/multinode reconfigure --tags glance nova cinder 

标签:ceph,keyring,nova,Ceph,完结,cinder,Openstack,glance,pool
From: https://blog.csdn.net/weixin_39972353/article/details/141605210

相关文章

  • ceph集群
    环境3台centos 8机器,每台机器上边3个磁盘机器名:ceph1、ceph2、ceph3ceph-ansible集群部署在ceph1上边准备好ceph-ansiblegitclonehttps://github.com/ceph/ceph-ansible.gitcdceph-ansiblegitcheckoutstable-5.0#centos7用4.0pip3install-rrequirements.txt......
  • Matplotlib基础入门--数据分析三大件完结
    Python数据分析三大件基础入门已经跟新完毕其余两篇如下:Numpy:《Python数据科学手册》—Numpy学习笔记(万字)Pandas:机器学习/数据分析–Pandas常用50个基础操作欢迎收藏+点赞+关注,下一步将更新机器学习/数据分析相关案例前言Matplotlib是python的一个绘图库,提......
  • C/C++语言基础--指针三大专题详解3,完结篇(包括指针做函数参数,函数指针,回调函数,左右法
    本专栏目的更新C/C++的基础语法,包括C++的一些新特性前言指针是C/C++的灵魂,和内存地址相关联,运行的时候速度快,但是同时也有很多细节和规范要注意的,毕竟内存泄漏是很恐怖的指针打算分三篇文章进行讲解,本专题是三,完结篇,介绍了指针做函数参数,函数指针,回调函数,左右法则解决复......
  • ceph-messenger模块代码走读(1)
    messenger代码走读messenger的使用以mgr代码为例,看看messengrr的初始化和启动。//构造函数,初始化一个client_messenger对象。MgrStandby::MgrStandby(intargc,constchar**argv):Dispatcher(g_ceph_context),monc{g_ceph_context,poolctx},client_messenger(M......
  • 探索 Kubernetes 持久化存储之 Rook Ceph 初窥门径
    在Kubernetes生态系统中,持久化存储是支撑业务应用稳定运行的基石,对于维护整个系统的健壮性至关重要。对于选择自主搭建Kubernetes集群的运维架构师来说,挑选合适的后端持久化存储解决方案是关键的选型决策。目前,Ceph、GlusterFS、NFS、Longhorn和openEBS等解决方案已在业界......
  • ceph如何进行数据的读写(2)
    本章摘要上文说到,librados/IoctxImpl.cc中调用objecter_op和objecter的op_submit函数,进行op请求的封装、加参和提交。本文详细介绍相关函数的调用。osdc中的操作初始化Op对象,提交请求设置Op对象的时间,oid,操作类型等信息。//osdc/Objector.h//mid-levelhelpersOp*pr......
  • ceph如何进行数据的读写(3)
    本章摘要上文说到,osdc中封装请求,使用message中的相关机制将请求发送出去。本文详细介绍osd服务端如何进行请求的接收。osd初始化osd启动时,定义了message变量ms_public,该变量绑定public网络,负责接收客户端的请求。ms_public会启动对应的线程进行接收,并指定接收函数。//ceph_......
  • ceph如何进行数据的读写(1)
    版本ceph版本为17.ceph如何进行读写接口的实现Ceph的客户端通过librados的接口进行集群的访问,这里的访问包括:1)对集群的整体访问2)对象的访问两类接口,这套接口(API)包括C、C++和Python的实现,接口通过网络实现对Ceph集群的访问。在客户端层面,可以在自己的程序中调用该接口,从而集......
  • #java学习笔记(面向对象)----(未完结)
    一基础相关知识点:1.一个对象的调用首先我们创建一个Phone类publicclassPhone{//成员变量Stringname;intage;Stringfavourite;//成员方法publicvoidmyName(){System.out.println(name);}publicvoidmyAge(){......
  • Ceph介绍
    1. Ceph简介Ceph是一种开源的分布式存储系统,它旨在提供高性能、高可靠性和可伸缩性的存储解决方案。Ceph作为一个软件定义存储(SDS)系统可以在通用硬件上运行,并支持多种存储类型,包括对象存储、块存储和文件系统。Ceph从2006年开源至今,一直是主流的分布式存储系统,已在OpenStac......