2.10. 关闭并重启 Red Hat Ceph Storage 集群
按照以下步骤关闭和重新引导 Ceph 集群。
先决条件
- 一个正在运行的 Red Hat Ceph Storage 集群。
-
具有
root
访问权限。
流程
关闭 Red Hat Ceph Storage 集群
- 停止使用该集群上的 RBD 镜像和 RADOS 网关以及任何其他客户端的客户端。
-
在继续操作前,集群必须处于健康状态(
Health_OK
以及所有的 PG 为active+clean
)。在具有客户端密钥环的节点上运行ceph 状态
,如 Ceph 监控器或 OpenStack 控制器节点,以确保集群健康。 如果使用 Ceph 文件系统(
CephFS
),则必须关闭CephFS
集群。缩减CephFS
集群是通过将排名数量减少到1
来完成,设置cluster_down
标志,然后对最后的等级失败。例如:
[root@osd ~]# ceph fs set FS_NAME max_mds 1 [root@osd ~]# ceph mds deactivate FS_NAME:1 # rank 2 of 2 [root@osd ~]# ceph status # wait for rank 1 to finish stopping [root@osd ~]# ceph fs set FS_NAME cluster_down true [root@osd ~]# ceph mds fail FS_NAME:0
设置
cluster_down
标志可防止待机使用失败的等级。设置
noout
、norecover
、norebalance
、nobackfill
、nodown
和pause
标志。在具有客户端密钥环的节点上运行以下命令:例如,Ceph Monitor 或 OpenStack 控制器节点:[root@mon ~]# ceph osd set noout [root@mon ~]# ceph osd set norecover [root@mon ~]# ceph osd set norebalance [root@mon ~]# ceph osd set nobackfill [root@mon ~]# ceph osd set nodown [root@mon ~]# ceph osd set pause
逐一关闭 OSD 节点:
[root@osd ~]# systemctl stop ceph-osd.target
逐一关闭 monitor 节点:
[root@mon ~]# systemctl stop ceph-mon.target
重新引导 Red Hat Ceph Storage 集群
- 启动管理节点。
打开监控节点:
[root@mon ~]# systemctl start ceph-mon.target
打开 OSD 节点:
[root@osd ~]# systemctl start ceph-osd.target
- 等待所有节点上线。验证所有服务都已启动,且节点之间的连接是正常的。
取消设置
noout
、norecover
、norebalance
、nobackfill
、nodown
和pause
标志。在具有客户端密钥环的节点上运行以下命令:例如,Ceph Monitor 或 OpenStack 控制器节点:[root@mon ~]# ceph osd unset noout [root@mon ~]# ceph osd unset norecover [root@mon ~]# ceph osd unset norebalance [root@mon ~]# ceph osd unset nobackfill [root@mon ~]# ceph osd unset nodown [root@mon ~]# ceph osd unset pause
如果使用 Ceph 文件系统(
CephFS
),则必须通过将cluster_down
标志设置为false
来备份CephFS
集群:[root@admin~]# ceph fs set FS_NAME cluster_down false
-
验证集群处于健康状态(
Health_OK
和所有 PGactive+clean
)。在具有客户端密钥环的节点中运行ceph status
。例如,Ceph Monitor 或 OpenStack 控制器节点确保集群运行正常。