7.2. 准备升级


在开始升级 Red Hat Ceph Storage 前,需要完成一些任务。这些步骤适用于 Red Hat Ceph Storage 集群的裸机和容器部署,除非为其中一个集群指定。

重要

您只能升级到最新版本的 Red Hat Ceph Storage 4。例如,如果版本 4.1 可用,则无法从 3 升级到 4.0;您必须直接升级到 4.1。

重要

如果使用 FileStore 对象存储,在从 Red Hat Ceph Storage 3 升级到 Red Hat Ceph Storage 4 后,您必须迁移到 BlueStore。

重要

当同时将 Red Hat Enterprise Linux 7 升级到 Red Hat Enterprise Linux 8 时,您无法使用 ceph-ansible 升级 Red Hat Ceph Storage。您必须继续使用 Red Hat Enterprise Linux 7。要升级操作系统,请参阅手动升级 Red Hat Ceph Storage 集群和操作系统。

重要

对于 Red Hat Ceph Storage 4.2z2 及更新的版本,默认情况下 bluefs_buffered_io 选项被设置为 True。这个选项使 BlueFS 能够在某些情况下执行缓冲的读取,并允许内核页面缓存作为辅助缓存进行读取,如 RocksDB 块读取。例如,如果 RocksDB 块缓存不足以在 OMAP 迭代期间保存所有块,则可以从页面缓存而不是磁盘中读取它们。当 osd_memory_target 太小而无法存放块缓存中的所有条目时,这可显著提高性能。当前启用 bluefs_buffered_io 并禁用系统级别交换可防止性能下降。

先决条件

  • 对存储集群中所有节点的根级别访问权限。
  • 存储集群中所有节点的系统时钟会被同步。如果 monitor 节点没有同步,升级过程可能无法正确完成。
  • 如果从版本 3 升级,版本 3 集群会升级到最新版本的 Red Hat Ceph Storage 3。
  • 在升级到版本 4 之前,如果 Prometheus 节点导出器服务正在运行,请停止该服务:

    示例

    [root@mon ~]# systemctl stop prometheus-node-exporter.service

    重要

    这是一个已知问题,将在即将发布的 Red Hat Ceph Storage 发行版中解决。有关此问题的更多详细信息,请参阅红帽知识库文章。

    注意

    对于在升级过程中无法访问互联网的 Bare-metal 或 Container Red Hat Ceph Storage 集群节点,请按照 Red Hat Ceph Storage 安装指南中 中的 将 Red Hat Ceph Storage 节点注册到 CDN 一节中的步骤附加订阅。

流程

  1. 以 root 用户身份登录存储集群中的所有节点。
  2. 如果 Ceph 节点没有连接到 Red Hat Content Delivery Network (CDN),您可以使用 ISO 镜像来升级 Red Hat Ceph Storage,方法是使用最新版本的 Red Hat Ceph Storage 新本地存储库。
  3. 如果将 Red Hat Ceph Storage 从版本 3 升级到版本 4,请删除现有的 Ceph 控制面板安装。

    1. 在 Ansible 管理节点上,切换到 cephmetrics-ansible 目录:

      [root@admin ~]# cd /usr/share/cephmetrics-ansible
    2. 运行 purge.yml playbook 以删除现有的 Ceph 仪表板安装:

      [root@admin cephmetrics-ansible]# ansible-playbook -v purge.yml
  4. 如果将 Red Hat Ceph Storage 从版本 3 升级到版本 4,请在 Ansible 管理节点上启用 Ceph 和 Ansible 存储库:

    Red Hat Enterprise Linux 7

    [root@admin ~]# subscription-manager repos --enable=rhel-7-server-rhceph-4-tools-rpms --enable=rhel-7-server-ansible-2.9-rpms

    Red Hat Enterprise Linux 8

    [root@admin ~]# subscription-manager repos --enable=rhceph-4-tools-for-rhel-8-x86_64-rpms --enable=ansible-2.9-for-rhel-8-x86_64-rpms

  5. 在 Ansible 管理节点上,确保安装了最新版本的 ansible 和 ceph-ansible 软件包。

    Red Hat Enterprise Linux 7

    [root@admin ~]# yum update ansible ceph-ansible

    Red Hat Enterprise Linux 8

    [root@admin ~]# dnf update ansible ceph-ansible

  6. 编辑 infrastructure-playbooks/rolling_update.yml playbook,并将 health_osd_check_retries 和 health_osd_check_delay 值分别改为 50 和 30 :

    health_osd_check_retries: 50
    health_osd_check_delay: 30

    对于每个 OSD 节点,这些值可使 Ansible 等待最多 25 分钟,并且每隔 30 秒检查存储集群运行状况,等待继续升级过程。

    注意

    根据存储集群的已用存储容量,调整 health_osd_check_retries 选项的值。例如,如果您在 436 TB 中使用 218 TB,基本上使用 50% 的存储容量,然后将 health_osd_check_retries 选项设置为 50。

  7. 如果要升级的存储集群包含使用 exclusive-lock 功能的 Ceph 块设备镜像,请确保所有 Ceph 块设备用户都有将客户端列入黑名单的权限:

    ceph auth caps client.ID mon 'allow r, allow command "osd blacklist"' osd 'EXISTING_OSD_USER_CAPS'
  8. 如果存储集群最初使用 Cockpit 安装,请在 /usr/share/ceph-ansible 目录中创建一个符号链接到 Cockpit 创建它的清单文件,位于 /usr/share/ansible-runner-service/inventory/hosts :

    1. 进入 /usr/share/ceph-ansible 目录:

      # cd /usr/share/ceph-ansible
    2. 创建符号链接:

      # ln -s /usr/share/ansible-runner-service/inventory/hosts hosts
  9. 要使用 ceph-ansible 升级集群,请在 etc/ansible/hosts 目录中创建符号链接到 hosts 清单文件:

    # ln -s /etc/ansible/hosts hosts
  10. 如果存储集群最初使用 Cockpit 安装,请将 Cockpit 生成的 SSH 密钥复制到 Ansible 用户的 ~/.ssh 目录中:

    1. 复制密钥:

      # cp /usr/share/ansible-runner-service/env/ssh_key.pub /home/ANSIBLE_USERNAME/.ssh/id_rsa.pub
      # cp /usr/share/ansible-runner-service/env/ssh_key /home/ANSIBLE_USERNAME/.ssh/id_rsa

      将 ANSIBLE_USERNAME 替换为 Ansible 的用户名,通常是 admin。

      示例

      # cp /usr/share/ansible-runner-service/env/ssh_key.pub /home/admin/.ssh/id_rsa.pub
      # cp /usr/share/ansible-runner-service/env/ssh_key /home/admin/.ssh/id_rsa

    2. 在密钥文件中设置适当的所有者、组群和权限:

      # chown ANSIBLE_USERNAME:_ANSIBLE_USERNAME_ /home/ANSIBLE_USERNAME/.ssh/id_rsa.pub
      # chown ANSIBLE_USERNAME:_ANSIBLE_USERNAME_ /home/ANSIBLE_USERNAME/.ssh/id_rsa
      # chmod 644 /home/ANSIBLE_USERNAME/.ssh/id_rsa.pub
      # chmod 600 /home/ANSIBLE_USERNAME/.ssh/id_rsa

      将 ANSIBLE_USERNAME 替换为 Ansible 的用户名,通常是 admin。

      示例

      # chown admin:admin /home/admin/.ssh/id_rsa.pub
      # chown admin:admin /home/admin/.ssh/id_rsa
      # chmod 644 /home/admin/.ssh/id_rsa.pub
      # chmod 600 /home/admin/.ssh/id_rsa

其它资源

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部