本文介绍了使用 kolla-ansible 安装 ceph 进行多合一设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 kolla-ansible 并启用 ceph 来部署多合一配置

I am trying to deploy the all-in-one configuration using kolla-ansible with ceph enabled

enable_ceph: "yes"
#enable_ceph_mds: "no"
enable_ceph_rgw: "yes"
#enable_ceph_nfs: "no"
enable_ceph_dashboard: "{{ enable_ceph | bool }}"
#enable_chrony: "yes"
enable_cinder: "yes"
enable_cinder_backup: "yes"
glance_backend_ceph: "yes"
gnocchi_backend_storage: "{{ 'ceph' if enable_ceph|bool else 'file' }}"
cinder_backend_ceph: "{{ enable_ceph }}"
cinder_backup_driver: "ceph"
nova_backend_ceph: "{{ enable_ceph }}"

而且,我的设置包括一个带有 Ubuntu 18.04.4 桌面版的 Virtual Box VM,带有 2 个 CPU 内核、30 GB 磁盘(单磁盘)、2GB RAM,分区类型为 msdos.

And, my setup consists of a Virtual Box VM with Ubuntu 18.04.4 desktop version with 2 CPU cores, 30 GB Disk (single disk), 2GB RAM, the partitioning type is msdos.

ansible 版本==2.9.7

ansible version==2.9.7

kolla-ansible 版本==9.1.0

kolla-ansible version==9.1.0

为了使用 kolla-ansible 安装 ceph OSD,我读到分区应该具有名称 KOLLA_CEPH_OSD_BOOTSTRAP_BS.

In order to install ceph OSD using kolla-ansible i read that a partition should have the name KOLLA_CEPH_OSD_BOOTSTRAP_BS.

因此,我创建了 20 GB 的根分区,即/dev/sda1,然后创建了一个扩展分区/dev/sda2 用于其余 20GB,然后是两个逻辑分区(/dev/sda5 和/dev/sda6),每个分区为 10GB对于 OSD.但是在 msdos 类型的分区中,没有为分区分配名称的功能.

Hence, i created root partition with 20 GB i.e /dev/sda1 and then an extended partition /dev/sda2 for the rest 20GB and followed by two logical partitions (/dev/sda5 and /dev/sda6) each of 10GB for OSD. But in msdos type partitioning there is no feature to allocate name to partitions.

所以我的问题是:

  1. 如果是 msdos 类型的分区,我该如何标记分区,以便 kolla-ansible 识别/dev/sda5 和/dev/sda6 是为 Ceph-OSD 指定的?
  2. 是否必须有一个单独的存储驱动器,而不是包含用于 Ceph OSD 的操作系统的驱动器(我知道不建议将所有存储驱动器都放在一个磁盘中)?
  3. 为了使用 kolla-ansible 安装 Ceph-OSD,我必须如何配置我的单驱动器 HD 空间?

PS:我还尝试使用 kolla-ansible 使用 OpenStack VM(4 个 CPU 内核,80GB 磁盘空间 - 单驱动器,因为我没有在我的 OpenStack 基础架构中安装 Cinder)和 Ubuntu 18.04.4 Cloud 安装 ceph镜像,具有GPT分区类型,支持命名分区,分区如下:

P.S: I also tried to install ceph using kolla-ansible using an OpenStack VM (4 CPU cores, 80GB disk space - single drive, as i didn"t install Cinder in my OpenStack infra.) and Ubuntu 18.04.4 Cloud image, which has GPT partition type and supports naming partitions. The partitions were as follows:

/dev/vda1 用于根分区

/dev/vda1 for root partition

/dev/vda2 用于 ceph OSD

/dev/vda2 for ceph OSD

/dev/vda3 用于 ceph OSD

/dev/vda3 for ceph OSD

但缺点是,kolla-ansible 擦除了整个磁盘并导致安装失败.

But the drawback was that, kolla-ansible wiped out complete disk and resulted in failure in installation.

非常感谢任何帮助.非常感谢.

Any help is highly appreciated. Thanks a lot in advance.

推荐答案

我也安装了一个 Kolla-Ansible 单节点一体机,以 Ceph 作为存储后端,所以我遇到了同样的问题.

I also had installed an Kolla-Ansible single-node all-in-one with Ceph as storage backend, so I had the same problem.

是的,ceph 的 bluestore 安装不适用于单个分区.我也尝试过不同的标记方式,但对我来说它只适用于整个磁盘,而不是分区.因此,为您的虚拟设置创建一个全新的磁盘,例如 /dev/vdb.

Yes, the bluestore installation of the ceph doesn't work with a single partition. I had also tried different ways of labeling, but for me it only worked with a whole disk, instead of a partition. So for your virtual setup create a whole new disk, for example /dev/vdb.

对于标签,我使用以下作为 bash 脚本:

For labeling, I used the following as bash-script:

#!/bin/bash
DEV="/dev/vdb"
(
echo g # create GPT partition table
echo n # new partiton
echo   # partition number (automatic)
echo   # start sector (automatic)
echo +10G # end sector (use 10G size)
echo w # write changes
) | fdisk $DEV
parted $DEV -- name 1 KOLLA_CEPH_OSD_BOOTSTRAP_BS

请注意,开头的 DEV 已为您的设置正确设置.这会在新磁盘上创建一个新的分区表和一个 10GB 大小的分区.kolla-ansible deploy-run 注册标签并擦除整个磁盘,所以size-value没什么可说的,只针对磁盘上的临时分区.

Be aware, that DEV at the beginning is correctly set for your setup. This creates a new partiton table and one partition on the new disc with 10GB size. The kolla-ansible deploy-run register the label and wipe the whole disc, so the size-value has nothing to say and is only for the temporary partition on the disc.

一张光盘足以用于 kolla-ansible 中的 Ceph-OSD.您不需要第二个 OSD.为此,当您使用默认 kolla 安装路径时,在此路径中的 kolla-ansible 设置中添加以下配置文件:/etc/kolla/config/ceph.conf 内容:

One single disc is enough for the Ceph-OSD in kolla-ansible. You don't need a second OSD. For this, add the following config-file in your kolla-ansible setup in this path, when you used the default kolla installation path: /etc/kolla/config/ceph.conf with the content:

[global]
osd pool default size = 1
osd pool default min size = 1

这是为了确保 kolla-ansible 只请求一个 OSD.如果带有 globals.yml 的 kolla 目录不在 /etc/kolla/ 下,则还必须更改配置文件的路径.

This is to make sure, that there is only one OSD requested by kolla-ansible. If your kolla-directory with the globals.yml is not under /etc/kolla/, you have to change the path of the config-file as well.

使用具有多个分区的单个磁盘进行设置的解决方案是将 kolla-ansible 设置中的 ceph-storage 的存储类型从 bluestore 切换到旧的 filestore OSD 类型.这也需要不同的分区标签,如此处所写:https://docs.openstack.org/kolla-ansible/rocky/reference/ceph-guide.html#using-an-external-journal-drive.对于文件存储,您需要一个标签为 KOLLA_CEPH_OSD_BOOTSTRAP_FOO 的分区和一个标签为 KOLLA_CEPH_OSD_BOOTSTRAP_FOO_J 的小日志分区(名称中的 FOO 确实是必需的....).为了能够将您的 kolla 安装切换到文件存储 OSD 类型,通过在主机旁边添加 ceph_osd_store_type=filestore 来编辑多合一文件的 [storage] 部分,如下所示, 覆盖默认的 bluestore.

Solution for setup with one single disc with multiple partitions is to switch the storage-type of the ceph-storage in the kolla-ansible setup from bluestore to the older filestore OSD type. This also requires different partition-labels like written here: https://docs.openstack.org/kolla-ansible/rocky/reference/ceph-guide.html#using-an-external-journal-drive .With filestore you need one parition with the label KOLLA_CEPH_OSD_BOOTSTRAP_FOO and a small journal-partition with label KOLLA_CEPH_OSD_BOOTSTRAP_FOO_J (the FOO in the name is really required...). To be able to switch your kolla-installation to filestore OSD type, edit all-in-one file's [storage] section by adding ceph_osd_store_type=filestore next to the host as follows, to override the default bluestore.

[storage]
localhost       ansible_connection=local ceph_osd_store_type=filestore

以上方法已经过ansible==2.9.7kolla-ansible==9.1.0OpenStack Train release 的测试和之前的版本.

The above method has been tested with ansible==2.9.7 and kolla-ansible==9.1.0 and OpenStack Train release and prior releases.

这篇关于使用 kolla-ansible 安装 ceph 进行多合一设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 18:23