7.4. 将 Red Hat Ceph Storage RGW 迁移到外部 RHEL 节点


对于超融合基础架构(HCI)或专用存储节点,您必须将 Red Hat OpenStack Platform Controller 节点中包含的 Ceph 对象网关(RGW)守护进程迁移到现有的外部 Red Hat Enterprise Linux (RHEL)节点。外部 RHEL 节点通常包括 HCI 环境或 Red Hat Ceph Storage 节点的 Compute 节点。您的环境必须具有 Red Hat Ceph Storage 7 或更高版本,并由 cephadm 或 Ceph Orchestrator 管理。

先决条件

7.4.1. 迁移 Red Hat Ceph Storage RGW 后端

您必须将 Ceph 对象网关(RGW)后端从 Controller 节点迁移到 Red Hat Ceph Storage 节点。为确保将正确数量的服务分发到可用的节点,您可以使用 cephadm 标签来引用部署了给定守护进程类型的一组节点。有关卡图的更多信息,请参阅 Red Hat Ceph Storage 守护进程卡。以下流程假设您有三个目标节点 cephstorage-0cephstorage-1cephstorage-2

流程

  1. 将 RGW 标签添加到您要将 RGW 后端迁移到的 Red Hat Ceph Storage 节点:

    $ sudo cephadm shell -- ceph orch host label add cephstorage-0 rgw;
    $ sudo cephadm shell -- ceph orch host label add cephstorage-1 rgw;
    $ sudo cephadm shell -- ceph orch host label add cephstorage-2 rgw;
    
    Added label rgw to host cephstorage-0
    Added label rgw to host cephstorage-1
    Added label rgw to host cephstorage-2
    
    $ sudo cephadm shell -- ceph orch host ls
    
    HOST       	ADDR       	LABELS      	STATUS
    cephstorage-0  192.168.24.54  osd rgw
    cephstorage-1  192.168.24.44  osd rgw
    cephstorage-2  192.168.24.30  osd rgw
    controller-0   192.168.24.45  _admin mon mgr
    controller-1   192.168.24.11  _admin mon mgr
    controller-2   192.168.24.38  _admin mon mgr
    
    6 hosts in cluster
  2. 在 spec 目录中找到 RGW spec 和 dump :

    $ SPEC_DIR=${SPEC_DIR:-"$PWD/ceph_specs"}
    $ mkdir -p ${SPEC_DIR}
    $ sudo cephadm shell -- ceph orch ls --export rgw > ${SPEC_DIR}/rgw
    $ cat ${SPEC_DIR}/rgw
    networks:
    - 172.17.3.0/24
    placement:
      hosts:
      - controller-0
      - controller-1
      - controller-2
    service_id: rgw
    service_name: rgw.rgw
    service_type: rgw
    spec:
      rgw_frontend_port: 8080
      rgw_realm: default
      rgw_zone: default

    本例假定 172.17.3.0/24存储网络

  3. placement 部分中,确保设置了 标签和 rgw_frontend_port 值:

    ---
    networks:
    - 172.17.3.0/24
    1
    
    placement:
      label: rgw 
    2
    
    service_id: rgw
    service_name: rgw.rgw
    service_type: rgw
    spec:
      rgw_frontend_port: 8090 
    3
    
      rgw_realm: default
      rgw_zone: default
      rgw_frontend_ssl_certificate: ... 
    4
    
      ssl: true
    1
    添加部署 RGW 后端的存储网络。
    2
    将 Controller 节点替换为 label: rgw 标签。
    3
    rgw_frontend_port 值更改为 8090,以避免与 Ceph ingress 守护进程冲突。
    4
    可选:如果启用了 TLS,请添加 SSL 证书和密钥串联,如 配置持久性存储 中的 为外部 Red Hat Ceph Storage 集群配置 RGW 所述。
  4. 使用编配器 CLI 应用新的 RGW 规格:

    $ SPEC_DIR=${SPEC_DIR:-"$PWD/ceph_specs"}
    $ sudo cephadm shell -m ${SPEC_DIR}/rgw -- ceph orch apply -i /mnt/rgw

    此命令触发重新部署,例如:

    ...
    osd.9                     	cephstorage-2
    rgw.rgw.cephstorage-0.wsjlgx  cephstorage-0  172.17.3.23:8090   starting
    rgw.rgw.cephstorage-1.qynkan  cephstorage-1  172.17.3.26:8090   starting
    rgw.rgw.cephstorage-2.krycit  cephstorage-2  172.17.3.81:8090   starting
    rgw.rgw.controller-1.eyvrzw   controller-1   172.17.3.146:8080  running (5h)
    rgw.rgw.controller-2.navbxa   controller-2   172.17.3.66:8080   running (5h)
    
    ...
    osd.9                     	cephstorage-2
    rgw.rgw.cephstorage-0.wsjlgx  cephstorage-0  172.17.3.23:8090  running (19s)
    rgw.rgw.cephstorage-1.qynkan  cephstorage-1  172.17.3.26:8090  running (16s)
    rgw.rgw.cephstorage-2.krycit  cephstorage-2  172.17.3.81:8090  running (13s)
  5. 确保新的 RGW 后端可以在新端口上访问,以便稍后在端口 8080 上启用入口守护进程。登录到包含 RGW 的每个 Red Hat Ceph Storage 节点,并添加 iptables 规则,以允许连接到 Red Hat Ceph Storage 节点上的 8080 和 8090 端口:

    $ iptables -I INPUT -p tcp -m tcp --dport 8080 -m conntrack --ctstate NEW -m comment --comment "ceph rgw ingress" -j ACCEPT
    $ iptables -I INPUT -p tcp -m tcp --dport 8090 -m conntrack --ctstate NEW -m comment --comment "ceph rgw backends" -j ACCEPT
    $ sudo iptables-save
    $ sudo systemctl restart iptables
  6. 如果在现有部署中使用了 nftables,请编辑 /etc/nftables/tripleo-rules.nft 并添加以下内容:

    # 100 ceph_rgw {'dport': ['8080','8090']}
    add rule inet filter TRIPLEO_INPUT tcp dport { 8080,8090 } ct state new counter accept comment "100 ceph_rgw"
  7. 保存该文件。
  8. 重启 nftables 服务:

    $ sudo systemctl restart nftables
  9. 验证是否应用了规则:

    $ sudo nft list ruleset | grep ceph_rgw
  10. 从 Controller 节点(如 controller-0 )尝试访问 RGW 后端:

    $ curl http://cephstorage-0.storage:8090;

    您应该观察以下输出:

    <?xml version="1.0" encoding="UTF-8"?><ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Owner><ID>anonymous</ID><DisplayName></DisplayName></Owner><Buckets></Buckets></ListAllMyBucketsResult>

    对部署 RGW 守护进程的每个节点重复验证。

  11. 如果您将 RGW 后端迁移到 Red Hat Ceph Storage 节点,则没有 internalAPI 网络,除了 HCI 节点的情况。您必须重新配置 RGW keystone 端点,以指向您传播的外部网络:

    [ceph: root@controller-0 /]# ceph config dump | grep keystone
    global   basic rgw_keystone_url  http://172.16.1.111:5000
    
    [ceph: root@controller-0 /]# ceph config set global rgw_keystone_url http://<keystone_endpoint>:5000
    • 在采用 Identity 服务时,将 < keystone_endpoint > 替换为在 OpenStackControlPlane CR 中部署的服务的 Identity 服务(keystone)内部端点。如需更多信息,请参阅 使用 Identity 服务
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

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

让开源更具包容性

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

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部