第 4 章 交错升级
作为存储管理员,您可以选择以阶段性的形式升级 Red Hat Ceph Storage 组件,而不是一次升级所有组件。ceph orch upgrade
命令允许您指定选项来限制单个升级命令升级哪些守护进程。
如果要从不支持交错升级的版本进行升级,您需要首先手动升级 Ceph Manager (ceph-mgr
) 守护进程。有关从之前版本执行交错升级的更多信息,请参阅从之前版本进行升级。
4.1. 交错升级选项
ceph orch upgrade
命令支持几个选项来以阶段的形式升级集群组件。交错升级选项包括:
-
--daemon_types:
--daemon_types
选项使用以逗号分隔的守护进程类型列表,只升级这些类型的守护进程。此选项的有效守护进程类型包括mgr
,mon
,crash
,osd
,mds
,rgw
,rbd-mirror
,cephfs-mirror
, 和nfs
。 -
--services:
--services
选项与--daemon-types
相互排斥,每次只能使用其中一个选项,仅升级属于这些服务的守护进程。例如,您无法同时提供 OSD 和 RGW 服务。 -
--hosts :您可以将
--hosts
选项与--daemon_types
、--services
结合使用,或者单独使用这个选项。--hosts
选项参数的格式与编配器 CLI 放置规格的命令行选项相同。 -
--limit:
--limit
选项使用一个大于零的整数,它提供了cephadm
要升级的守护进程的数量限制。您可以将--limit
选项与--daemon_types
、--services
或--hosts
组合使用。例如,如果要升级host01
上的类型为osd
的守护进程,并将限制设置为3
,则cephadm
将最多升级 host01 上的三个 OSD 守护进程。
4.1.1. 执行交错升级
作为存储管理员,您可以使用 ceph orch upgrade
选项来限制单个升级命令升级哪些守护进程。
Cephadm 严格强制实施在升级场景中仍然存在的守护进程升级的顺序。当前升级顺序是:
- Ceph Manager 节点
- Ceph 监控节点
- Ceph-crash 守护进程
- Ceph OSD 节点
- Ceph 元数据服务器 (MDS) 节点
- Ceph 对象网关(RGW)节点
- Ceph RBD-mirror 节点
- CephFS-mirror 节点
- Ceph NFS 节点
如果您的参数所指定的守护进程升级没有遵循正常的顺序,则升级命令会阻止并记录在继续执行前需要先升级哪些守护进程。
示例
[ceph: root@host01 /]# ceph orch upgrade start --image registry.redhat.io/rhceph/rhceph-7-rhel9:latest --hosts host02 Error EINVAL: Cannot start upgrade. Daemons with types earlier in upgrade order than daemons on given host need upgrading. Please first upgrade mon.ceph-host01
在重启实例时不需要按照一定顺序进行。红帽建议重启实例,使其指向主镜像池,然后实例指向镜像池。
先决条件
- 运行 Red Hat Ceph Storage 5.3 或 6.1 的集群。
- 所有节点的根级别访问权限。
- 存储集群中至少有两个 Ceph 管理器节点:一个活跃节点和一个备用节点。
流程
登录
cephadm
shell:示例
[root@host01 ~]# cephadm shell
确定所有主机都在线,并且存储集群处于健康状态:
示例
[ceph: root@host01 /]# ceph -s
设置 OSD
noout
、noscrub
、和nodeep-scrub
标记,以防止 OSD 在升级过程中被标记为 out,并避免对集群造成不必要的负载:示例
[ceph: root@host01 /]# ceph osd set noout [ceph: root@host01 /]# ceph osd set noscrub [ceph: root@host01 /]# ceph osd set nodeep-scrub
检查服务版本和可用目标容器:
语法
ceph orch upgrade check IMAGE_NAME
示例
[ceph: root@host01 /]# ceph orch upgrade check registry.redhat.io/rhceph/rhceph-7-rhel9:latest
升级存储集群:
在特定主机上升级特定的守护进程类型:
语法
ceph orch upgrade start --image IMAGE_NAME --daemon-types DAEMON_TYPE1,DAEMON_TYPE2 --hosts HOST1,HOST2
示例
[ceph: root@host01 /]# ceph orch upgrade start --image registry.redhat.io/rhceph/rhceph-7-rhel9:latest --daemon-types mgr,mon --hosts host02,host03
指定特定的服务,并限制要升级的守护进程数量:
语法
ceph orch upgrade start --image IMAGE_NAME --services SERVICE1,SERVICE2 --limit LIMIT_NUMBER
示例
[ceph: root@host01 /]# ceph orch upgrade start --image registry.redhat.io/rhceph/rhceph-7-rhel9:latest --services rgw.example1,rgw1.example2 --limit 2
注意在交错升级时,如果使用限制参数,则在升级 Ceph Manager 守护进程后会刷新监控堆栈守护进程(包括 Prometheus 和
node-exporter
)。由于使用了限制参数,Ceph Manager 升级需要更长时间才能完成。监控堆栈守护进程的版本可能不会在 Ceph 发行版本之间有所变化,在这种情况下,它们只会重新部署。注意对参数进行限制的升级命令会验证开始升级前的选项,这样可能需要拉取新的容器镜像。因此,在您提供限制参数时,
upgrade start
命令可能需要一段时间才能返回。
要查看您仍然需要升级的守护进程,请运行
ceph orch upgrade check
或ceph versions
命令:示例
[ceph: root@host01 /]# ceph orch upgrade check --image registry.redhat.io/rhceph/rhceph-7-rhel9:latest
要完成交错升级,请验证所有剩余的服务的升级:
语法
ceph orch upgrade start --image IMAGE_NAME
示例
[ceph: root@host01 /]# ceph orch upgrade start --image registry.redhat.io/rhceph/rhceph-7-rhel9:latest
验证
验证 Ceph 集群的新 IMAGE_ID 和 VERSION :
示例
[ceph: root@host01 /]# ceph versions [ceph: root@host01 /]# ceph orch ps
升级完成后,取消设置
noout
、noscrub
和nodeep-scrub
标记:示例
[ceph: root@host01 /]# ceph osd unset noout [ceph: root@host01 /]# ceph osd unset noscrub [ceph: root@host01 /]# ceph osd unset nodeep-scrub
4.1.2. 从之前的版本执行标签升级
您可以通过提供必要的参数,在存储集群上执行标签升级
您可以通过提供必要的参数,在存储集群上执行标签升级。如果要从不支持交错升级的版本进行升级,您需要首先手动升级 Ceph Manager (ceph-mgr
) 守护进程。升级 Ceph Manager 守护进程后,您可以传递限制参数来完成提取升级。
在尝试此步骤前,验证您至少有两个正在运行的 Ceph Manager 守护进程。
先决条件
- 运行 Red Hat Ceph Storage 5.2 或更小的集群。
- 存储集群中至少有两个 Ceph 管理器节点:一个活跃节点和一个备用节点。
流程
登录到 Cephadm shell:
示例
[root@host01 ~]# cephadm shell
确定哪个 Ceph Manager 处于活跃状态且处于待机状态:
示例
[ceph: root@host01 /]# ceph -s cluster: id: 266ee7a8-2a05-11eb-b846-5254002d4916 health: HEALTH_OK services: mon: 2 daemons, quorum host01,host02 (age 92s) mgr: host01.ndtpjh(active, since 16h), standbys: host02.pzgrhz
手动升级每个备用 Ceph Manager 守护进程:
语法
ceph orch daemon redeploy mgr.ceph-HOST.MANAGER_ID --image IMAGE_ID
示例
[ceph: root@host01 /]# ceph orch daemon redeploy mgr.ceph-host02.pzgrhz --image registry.redhat.io/rhceph/rhceph-7-rhel9:latest
故障切换到升级的备用 Ceph Manager:
示例
[ceph: root@host01 /]# ceph mgr fail
检查备用 Ceph Manager 现在是否活跃:
示例
[ceph: root@host01 /]# ceph -s cluster: id: 266ee7a8-2a05-11eb-b846-5254002d4916 health: HEALTH_OK services: mon: 2 daemons, quorum host01,host02 (age 1h) mgr: host02.pzgrhz(active, since 25s), standbys: host01.ndtpjh
验证活跃的 Ceph Manager 是否已升级到新版本:
语法
ceph tell mgr.ceph-HOST.MANAGER_ID version
示例
[ceph: root@host01 /]# ceph tell mgr.host02.pzgrhz version { "version": "18.2.0-128.el8cp", "release": "reef", "release_type": "stable" }
- 重复步骤 2 - 6,将剩余的 Ceph Manager 升级到新版本。
检查所有 Ceph Manager 是否已升级到新版本:
示例
[ceph: root@host01 /]# ceph mgr versions { "ceph version 18.2.0-128.el8cp (600e227816517e2da53d85f2fab3cd40a7483372) pacific (stable)": 2 }
- 升级所有 Ceph Manager 后,您可以指定限制参数并完成交错升级的其余部分。
其它资源
- 有关执行升级和标签升级选项的更多信息,请参阅执行标签升级。