Deployment of Multi-Monitor Ceph 部署多监控器 Ceph
Deployment of Multi-Monitor Ceph
部署多监控器 Ceph
With Quincy, Ubuntu 22.04 and host-labels
使用 Quincy、Ubuntu 22.04 和主机标签
In a previous article, we described how to deploy a Ceph cluster with one monitor node and two OSD nodes. We used Ubuntu 20.04 and docker.io package and installed the Ceph pacific version.
在上一篇文章中,我们介绍了如何部署具有一个 monitor 节点和两个 OSD 节点的 Ceph 集群。我们使用了 Ubuntu 20.04 和 docker.io 软件包并安装了 Ceph Pacific 版本。
Here, we will deploy Ceph quincy version with multiple monitors and OSD nodes. We will use Ubuntu 22.04 and docker.io.
在这里,我们将部署具有多个监视器和 OSD 节点的 Ceph quincy 版本。我们将使用 Ubuntu 22.04 和 docker.io。
In this article we assume you are familiar to the basic deployment steps in the previous article.
在本文中,我们假设您熟悉上一篇文章中的基本部署步骤。
First we need to prepare the nodes for deployment: a user with sudo permission, dns entries (optional, but preferable), and container runtime (docker or podman). Please note that password-less ssh configuration for this user is unnecessary. Time-sync among nodes are also necessary.
首先,我们需要准备要部署的节点:具有 sudo 权限的用户、dns 条目(可选,但最好)和容器运行时(docker 或 podman)。请注意,此用户的无密码 ssh 配置是不必要的。节点之间的时间同步也是必要的。
Now, let’s start with getting a cephadm for quincy.
现在,让我们从 quincy 的 cephadm 开始。
curl --silent --remote-name --location https://github.com/ceph/ceph/raw/quincy/src/cephadm/cephadm
sudo ./cephadm add-repo --release quincy # Install cephadm
As of 2023/06/27, installing cephadm will produce this error.
自 2023 年 6 月 27 日起,安装 cephadm 将产生此错误。
The repository 'https://download.ceph.com/debian-quincy jammy Release' does not have a Release file.
If this happens, we can remove /etc/apt/sources.list.d/ceph.list and run sudo apt update. Please note that installing cephadm is optional and the downloaded executable is good enough for deployment.
如果发生这种情况,我们可以删除 /etc/apt/sources.list.d/ceph.list 并运行 sudo apt update。请注意,安装 cephadm 是可选的,下载的可执行文件足以进行部署。
Here, we have three monitor nodes: ceph-mon1, ceph-mon2 and ceph-mon3. We have 4 OSD nodes: ceph-osd01, ceph-osd02, ceph-osd03 and ceph-osd04. This time we will use labels for the deployment.
在这里,我们有三个监控节点:ceph-mon1、ceph-mon2 和 ceph-mon3。我们有 4 个 OSD 节点:ceph-osd01、ceph-osd02、ceph-osd03 和 ceph-osd04。这次我们将使用 labels 进行部署。
sudo ceph orch host label add ceph-mon1 mon sudo ceph orch host label add ceph-mon2 mon sudo ceph orch host label add ceph-mon3 mon sudo ceph orch host label add ceph-osd01 osd sudo ceph orch host label add ceph-osd02 osd sudo ceph orch host label add ceph-osd03 osd sudo ceph orch host label add ceph-osd04 osd
After these commands, we will have these hosts with labels.
在这些命令之后,我们将拥有带有标签的这些主机。

带有标签的主机列表
To deploy more monitors on the mon nodes, run this command.
要在 mon 节点上部署更多监视器,请运行此命令。
sudo ceph orch apply mon --placement="3 label:mon"
The placement with labels can be applied for any daemons.
带有标签的 placement 可以应用于任何守护进程。
sudo ceph orch apply prometheus --placement 'count:1 label:mon'
sudo ceph orch apply alertmanager --placement 'count:1 label:mon'
sudo ceph orch apply grafana --placement 'count:1 label:mon'
sudo ceph orch apply mgr --placement="2 ceph-mon1 ceph-mon2" # hostname can be used as well.
After these configurations are applied, we have the following. The exact placement is left to the Ceph cluster. As you see, the most daemons are on ceph-mon1. The output were trimmed for conciseness.
应用这些配置后,我们得到以下内容。确切的位置留给 Ceph 集群。如您所见,大多数守护进程都在 ceph-mon1 上。为了简洁起见,对输出进行了修剪。

It is worthwhile to pay attention on _admin label. When we bootstrap ceph-mon1 node, the label was created automatically and it is a special label. Once this label is applied to a node, two files will be created in /etc/ceph directory: ceph.conf and ceph.client.admin.keyring. Once the ceph-common package is installed, this can access the Ceph cluster.
值得关注 _admin 标签。当我们引导 ceph-mon1 节点时,标签是自动创建的,它是一个特殊标签。将此标签应用于节点后,将在 /etc/ceph 目录中创建两个文件:ceph.conf 和 ceph.client.admin.keyring。安装 ceph-common 软件包后,即可访问 Ceph 集群。
In this article, we explained how to deploy a Ceph cluster where
在本文中,我们解释了如何部署 Ceph 集群,其中
- Ceph version is Quincy Ceph 版本是 Quincy
- The OS is Ubuntu 22.04 and the container runtime is docker.io
作系统为 Ubuntu 22.04,容器运行时为 docker.io - host labels are used for daemon placement. This placement will give freedom to move daemon in case some hosts are down.
主机标签用于守护进程放置。这种放置方式将允许在某些主机宕机的情况下自由移动守护进程。