8.2. 手动升级 Ceph 监控节点及其操作系统

作为系统管理员,您可以手动将 Red Hat Ceph Storage 集群节点上的 Ceph 监控软件和 Red Hat Enterprise Linux 操作系统同时升级到新的主版本。

重要

一次仅在一个 monitor 节点上执行该步骤。要防止集群访问问题,请确保当前升级的 monitor 节点在继续下一节点之前重新正常运作。

先决条件

  • 一个正在运行的 Red Hat Ceph Storage 集群。
  • 节点正在运行 Red Hat Enterprise Linux 7 7.9。
  • 节点使用 Red Hat Ceph Storage 版本 3.3z6 或 4.1
  • 访问 Red Hat Enterprise Linux 8.3 的安装源。

流程

  1. 停止 monitor 服务:

    语法

    systemctl stop ceph-mon@MONITOR_ID

    MONITOR_ID 替换为 monitor 的 ID 号。

  2. 如果使用 Red Hat Ceph Storage 3,请禁用 Red Hat Ceph Storage 3 存储库。

    1. 禁用工具存储库:

      [root@mon ~]# subscription-manager repos --disable=rhel-7-server-rhceph-3-tools-rpms
    2. 禁用 mon 存储库:

      [root@mon ~]# subscription-manager repos --disable=rhel-7-server-rhceph-3-mon-rpms
  3. 如果使用 Red Hat Ceph Storage 4,请禁用 Red Hat Ceph Storage 4 存储库。

    1. 禁用工具存储库:

      [root@mon ~]# subscription-manager repos --disable=rhel-7-server-rhceph-4-tools-rpms
    2. 禁用 mon 存储库:

      [root@mon ~]# subscription-manager repos --disable=rhel-7-server-rhceph-4-mon-rpms
  4. 安装 leapp 实用程序。请参阅从 Red Hat Enterprise Linux 7 升级到 Red Hat Enterprise Linux 8
  5. 通过 leapp preupgrade 检查运行。请参阅从命令行评估可升级性
  6. /etc/ssh/sshd_config 中设置 PermitRootLogin yes
  7. 重启 OpenSSH SSH 守护进程:

    [root@mon ~]# systemctl restart sshd.service
  8. 从 Linux 内核中删除 iSCSI 模块:

    [root@mon ~]# modprobe -r iscsi
  9. 执行 从 RHEL 7 升级到 RHEL 8 的内容,以执行升级。
  10. 重新引导节点。
  11. 为 Red Hat Enterprise Linux 8 启用 Red Hat Ceph Storage 4 的软件仓库。

    1. 启用工具存储库:

      [root@mon ~]# subscription-manager repos --enable=rhceph-4-tools-for-rhel-8-x86_64-rpms
    2. 启用 mon 存储库:

      [root@mon ~]# subscription-manager repos --enable=rhceph-4-mon-for-rhel-8-x86_64-rpms
  12. 安装 ceph-mon 软件包:

    [root@mon ~]# dnf install ceph-mon
  13. 如果管理器服务与 monitor 服务在一起,请安装 ceph-mgr 软件包:

    [root@mon ~]# dnf install ceph-mgr
  14. 从尚未升级的 monitor 节点或已经恢复这些文件的节点恢复 ceph-client-admin.keyringceph.conf 文件。
  15. 将任何现有的 CRUSH bucket 切换到最新的 bucket 类型 straw2

    # ceph osd getcrushmap -o backup-crushmap
    # ceph osd crush set-all-straw-buckets-to-straw2
  16. 从 Red Hat Ceph Storage 3 升级到 Red Hat Ceph Storage 4 后,即可执行以下步骤:

    1. 启用消息传递 v2 协议 msgr2

      ceph mon enable-msgr2

      这将指示绑定到 6789 的旧默认端口的所有 Ceph 监控器也绑定到 3300 的新端口。

      重要

      在执行任何进一步的 Ceph Monitor 配置之前,确保所有 Ceph Monitor 都已从 Red Hat Ceph Storage 3 升级到 Red Hat Ceph Storage 4。

    2. 验证 monitor 的状态:

      ceph mon dump
      注意

      运行 nautilus OSD 不会自动绑定到其 v2 地址。必须重启它们。

  17. 对于从 Red Hat Ceph Storage 3 升级到 Red Hat Ceph Storage 4 的每个主机,将 ceph.conf 文件更新为没有指定任何监控端口,或引用 v2 和 v1 地址和端口。将 ceph.conf 文件中的任何配置选项导入到存储集群的配置数据库中。

    示例

    [root@mon ~]# ceph config assimilate-conf -i /etc/ceph/ceph.conf

    1. 检查存储集群的配置数据库。

      示例

      [root@mon ~]# ceph config dump

    2. 可选:升级到 Red Hat Ceph Storage 4 后,为每个主机创建一个最小的 ceph.conf 文件:

      示例

      [root@mon ~]# ceph config generate-minimal-conf > /etc/ceph/ceph.conf.new
      [root@mon ~]# mv /etc/ceph/ceph.conf.new /etc/ceph/ceph.conf

  18. 安装 leveldb 软件包:

    [root@mon ~]# dnf install leveldb
  19. 启动监控器服务:

    [root@mon ~]# systemctl start ceph-mon.target
  20. 如果管理器服务与监控服务在一起,也启动管理器服务:

    [root@mon ~]# systemctl start ceph-mgr.target
  21. 验证 monitor 服务是否已恢复,且是否在仲裁数中。

    [root@mon ~]# ceph -s

    services 下的 mon: 行中, 确保该节点列为已仲裁,而不是作为没有仲裁列出。

    示例

    mon: 3 daemons, quorum ceph4-mon,ceph4-mon2,ceph4-mon3 (age 2h)

  22. 如果 manager 服务与 monitor 服务在一起,请验证是否也启动:

    [root@mon ~]# ceph -s

    services 下的 mgr: 行中查找管理器的节点名称。

    示例

    mgr: ceph4-mon(active, since 2h), standbys: ceph4-mon3, ceph4-mon2

  23. 在所有 monitor 节点上重复上述步骤,直到它们都已升级。