Ceph Air-gapped Deployment Ceph 气隙部署

This article describes a way to deploy a Ceph cluster in an air-gapped environment. We will use Ubuntu 22.04 and Ceph Quicy version.
本文介绍了一种在气隙环境中部署 Ceph 集群的方法。我们将使用 Ubuntu 22.04 和 Ceph Quicy 版本。

Preparation  制备

We set up two servers: one for an Ubuntu repo and one for container registry. Ubuntu repo is for installing ceph-common package. Instructions for setting such servers are not in the scope of this article. We also download a cephadm executables.
我们设置了两台服务器:一台用于 Ubuntu 存储库,另一台用于容器注册表。Ubuntu 存储库用于安装 ceph-common 软件包。有关设置此类服务器的说明不在本文的讨论范围内。我们还下载了一个 cephadm 可执行文件。

curl --silent --remote-name --location https://github.com/ceph/ceph/raw/quicy/src/cephadm/cephadm

The list of the container images for Ceph Quicy deployment is here.
Ceph Quicy 部署的容器镜像列表在此处。

quay.io/ceph/ceph:v17.2.5
quay.io/prometheus/prometheus:v2.33.4
quay.io/ceph/ceph-grafana:8.3.5
quay.io/prometheus/alertmanager:v0.23.0
quay.io/prometheus/node-exporter:v1.3.1
docker.io/grafana/loki:2.4.0
docker.io/grafana/promtail:2.4.0
quay.io/ceph/haproxy:2.3
quay.io/ceph/keepalived:2.1.5
docker.io/maxwo/snmp-notifier:v1.2.1

We pull these images, tag them and push them to a private container registry. Our private registry for this deployment is on 172.25.64.1:5000.
我们提取这些镜像,标记它们并将它们推送到私有容器注册表。我们用于此部署的私有注册表位于 172.25.64.1:5000 上。

The overall environment is configured like this.
整个环境的配置是这样的。

Air-gapped environment for Ceph deployment
用于 Ceph 部署的气隙环境

Air-gapped deployment  气隙部署

Once the preparation steps are done, we need to bootstrap a Ceph node with two special option arguments. Here is a bootstrap command for air-gapped deployment.
完成准备步骤后,我们需要使用两个特殊 option 参数引导 Ceph 节点。下面是用于气隙部署的引导命令。

sudo cephadm --image 172.25.64.1:5000/ceph/ceph:v17.2.5 bootstrap --mon-ip 172.25.65.17 --config initial-ceph.conf 

Compared with the command in the previous article on non-air-gapped deployment, we have image option and config option. The config file initial-ceph.conf is shown below.
上一篇文章中关于非离线部署的命令相比,我们有了 image option 和 config option。配置文件 initial-ceph.conf 如下所示。

[mgr]
mgr/cephadm/container_image_prometheus = 172.25.64.1:5000/prometheus/prometheus:v2.33.4
mgr/cephadm/container_image_grafana = 172.25.64.1:5000/ceph/ceph-grafana:8.3.5
mgr/cephadm/container_image_alertmanager = 172.25.64.1:5000/prometheus/alertmanager:v0.23.0
mgr/cephadm/container_image_node_exporter = 172.25.64.1:5000/prometheus/node-exporter:v1.3.1
mgr/cephadm/container_image_loki = 172.25.64.1:5000/grafana/loki:2.4.0
mgr/cephadm/container_image_promtail = 172.25.64.1:5000/grafana/promtail:2.4.0
mgr/cephadm/container_image_haproxy = 172.25.64.1:5000/ceph/haproxy:2.3
mgr/cephadm/container_image_keepalived = 172.25.64.1:5000/ceph/keepalived:2.1.5
mgr/cephadm/container_image_snmp_gateway = 172.25.64.1:5000/maxwo/snmp-notifier:v1.2.1

We specify the ceph image as image option and all the other container images are specified in the config file.
我们将 ceph 镜像指定为 image 选项,所有其他容器镜像都在配置文件中指定。

Once the bootstrap step is successful, all the subsequent commands will work. The remaining steps are very similar to those of non air-gapped environment. The steps are summarized below and the actual commands are in the previous articles: Ceph Cluster Deploy and Deployment of Multi-Monitor Ceph.
引导步骤成功后,所有后续命令都将起作用。其余步骤与非气隙环境的步骤非常相似。下面总结了这些步骤,实际命令在前面的文章中:Ceph 集群部署多监控器 Ceph 的部署 

  • Add /etc/ceph/ceph.pub in /root/.ssh/authorized_key on the hosts to be added
    在要添加的主机上的 /root/.ssh/authorized_key 中添加 /etc/ceph/ceph.pub
  • Install ceph-common package
    安装 ceph-common 软件包
  • Set initial configuration like daemon placement and osd default pool size
    设置初始配置,如守护进程放置和 osd 默认池大小
  • Add hosts and host labels
    添加主机和主机标签
  • Add OSD daemons  添加 OSD 守护程序

Finally, we will have a Ceph cluster in the HEALTH_OK state.
最后,我们将有一个处于 HEALTH_OK 状态的 Ceph 集群。

Ceph health and daemon status
Ceph 运行状况和守护进程状态

As shown below, the containers are pulled from the private registry.
如下所示,容器是从私有注册表中提取的。

Container processes (some output are omitted)
容器进程(省略了一些输出)
Ceph
Distributed Storage
Airgapped
Deploymen
posted @ 2025-06-13 15:54  mofy  阅读(15)  评论(0)    收藏  举报