2.2. 为外部 Ceph 存储系统创建 OpenShift Data Foundation 集群


在 VMware vSphere 或用户置备的裸机基础架构上部署的 OpenShift Container Platform 上安装 OpenShift Data Foundation operator 后,需要创建新的 OpenShift Data Foundation 集群。

先决条件

  • 有效的 Red Hat OpenShift Data Foundation 高级订阅。要了解 OpenShift Data Foundation 订阅如何工作,请参阅与 OpenShift Data Foundation 订阅相关的知识库文章
  • 在部署 OpenShift Data Foundation 4.13 之前,请确保 OpenShift Container Platform 版本为 4.13 或更高版本。
  • 必须安装 OpenShift Data Foundation 操作器。如需更多信息,请参阅使用 Operator Hub 安装 OpenShift Data Foundation Operator
  • 要以外部模式检查 Red Hat Ceph Storage (RHCS) 与 Red Hat OpenShift Data Foundation 的支持性和互操作性,请转至 lab Red Hat OpenShift Data Foundation 支持性和互操作性检查器

    • 选择 Service TypeODF as Self-Managed Service
    • 从下拉菜单中选择适当的 Version
    • 在 Versions 选项卡中,点 External Mode 选项卡中支持的 RHCS 版本
  • 如果您已将红帽 Ceph 存储集群从低于 4.1.1 的版本更新为最新版本,且不是全新部署的集群,您必须在红帽 Ceph 存储集群中手动设置 CephFS 池的应用类型,以外部模式启用 CephFS PVC 创建。

    如需了解更多详细信息,请参阅在外部模式中对 CephFS PVC 创建进行故障排除

  • Red Hat Ceph Storage 必须安装并配置 Ceph 控制面板。如需更多信息,请参阅 Ceph 控制面板安装和访问
  • 建议外部 Red Hat Ceph Storage 集群启用 PG Autoscaler。如需更多信息,请参阅 Red Hat Ceph Storage 文档中的放置组自动扩展部分。
  • 外部 Ceph 集群应当预配置有一个现有的 RBD 池,供使用。如果不存在,请在进行 OpenShift Data Foundation 部署前,联系您的 Red Hat Ceph Storage 管理员创建一个。红帽建议为每个 OpenShift Data Foundation 集群使用单独的池。
  • 可选:如果在默认的 zonegroup 之外创建了一个 zonegroup,则需要将主机名 rook-ceph-rgw-ocs-external-storage-cephobjectstore.openshift-storage.svc 添加到 zonegroup,因为 OpenShift Data Foundation 会将 S3 请求发送到此主机名的 RADOS 对象网关(RGWs)。有关更多信息,请参阅红帽知识库解决方案 Ceph - 如何在 RGW zonegroup 中添加主机名?

流程

  1. Operators Installed Operators 查看所有已安装的 Operator。

    确保所选 项目openshift-storage

  2. 单击 OpenShift Data Foundation,然后单击 Create StorageSystem
  3. 在 Backing storage 页面中,选择以下选项:

    1. Deployment 类型选项选择 Full Deployment
    2. 从可用选项中选择 Connect a external storage platform
    3. Storage platform 选择 Red Hat Ceph Storage
    4. Next
  4. 在连接详情页面中,提供必要的信息:

    1. 在 Connect to external cluster 部分中,点 Download Script 链接,以下载用于提取 Ceph 集群详细信息的 python 脚本。
    2. 要提取 Red Hat Ceph Storage (RHCS) 集群详情,请联系 RHCS 管理员,以在带有 admin 密钥 的 Red Hat Ceph Storage 节点上运行下载的 python 脚本。

      1. 在 RHCS 节点上运行以下命令查看可用参数列表:

        # python3 ceph-external-cluster-details-exporter.py --help
        Copy to Clipboard Toggle word wrap
        重要

        如果在 Red Hat Enterprise Linux 7.x (RHEL 7.x) 集群中部署了 Red Hat Ceph Storage 4.x 集群,则使用 python 而不是 python3

        您也可以从 MON 容器(容器化部署)或 MON 节点(RPM 部署)运行脚本。

        注意

        使用 yum install cephadm 命令,然后运行 cephadm 命令,使用容器部署 RHCS 集群。您必须使用 cephadm 命令拉取 RHCS 容器镜像,而不是使用 yum 将 Ceph 软件包安装到节点上。如需更多信息,请参阅 RHCS 产品文档

      2. 要从 RHCS 集群检索外部集群详情,请运行以下命令:

        # python3 ceph-external-cluster-details-exporter.py \
        --rbd-data-pool-name <rbd block pool name>  [optional arguments]
        Copy to Clipboard Toggle word wrap

        例如:

        # python3 ceph-external-cluster-details-exporter.py --rbd-data-pool-name ceph-rbd --monitoring-endpoint xxx.xxx.xxx.xxx --monitoring-endpoint-port xxxx --rgw-endpoint xxx.xxx.xxx.xxx:xxxx --run-as-user client.ocs
        Copy to Clipboard Toggle word wrap

        在本例中,

        rbd-data-pool-name

        用于在 OpenShift Data Foundation 中提供块存储的必填参数。

        rgw-endpoint

        (可选)只有在 OpenShift Data Foundation 的 Ceph Rados 网关置备了对象存储时,才需要此参数。使用以下格式提供端点:<ip_address>:<port>

        注意

        完全限定域名 (FQDN) 也支持 <FQDN>:<PORT> 格式。

        monitoring-endpoint

        (可选)此参数接受从 OpenShift Container Platform 集群访问的活跃和待机 mgrs 的 IP 地址的逗号分隔列表。如果没有提供,则会自动填充该值。

        monitoring-endpoint-port

        (可选)它是与 --monitoring-endpoint 指定的 ceph-mgr Prometheus exporter 关联的端口。如果没有提供,则会自动填充该值。

        run-as-user

        (可选)此参数用于为脚本创建的 Ceph 用户提供名称。如果没有指定此参数,则会创建一个默认的用户名 client.healthchecker。新用户的权限被设置为:

        • caps: [mgr] allow command config
        • caps: [mon] allow r, allow command quorum_status, allow command version
        • caps: [osd] allow rwx pool=RGW_POOL_PREFIX.rgw.meta, allow r pool=.rgw.root, allow rw pool=RGW_POOL_PREFIX.rgw.control, allow rx pool=RGW_POOL_PREFIX.rgw.log, allow x pool=RGW_POOL_PREFIX.rgw.buckets.index

        附加标记:

        rgw-pool-prefix

        (可选) RGW 池的前缀。如果未指定,默认的前缀为 default

        rgw-tls-cert-path

        (可选)RADOS 网关端点 TLS 证书的文件路径。

        rgw-skip-tls

        (可选)此参数在提供自签名证书时会忽略 TLS 证书验证(不推荐)。

        ceph-conf

        (可选)Ceph 配置文件的名称。

        cluster-name

        (可选)Ceph 集群名称。

        output

        (可选)需要存储输出的文件。

        cephfs-metadata-pool-name

        (可选)CephFS 元数据池的名称。

        cephfs-data-pool-name

        (可选)CephFS 数据池的名称。

        cephfs-filesystem-name

        (可选)CephFS 文件的名称。

        rbd-metadata-ec-pool-name

        (可选)擦除代码 RBD 元数据池的名称。

        dry-run

        (可选)此参数会打印已执行命令的输出而不实际运行它们。

        restricted-auth-permission

        (可选)此参数将 cephCSIKeyrings auth 权限限制为特定的池和集群。需要与此一起设置的强制标记是 rbd-data-pool-namecluster-name。如果 CephFS 用户有限制,您也可以通过 cephfs-filesystem-name 标志,以便权限仅限于特定的 CephFS 文件系统。

        注意

        此参数必须只应用于新部署。要限制每个池和每个集群的 csi-users,您需要为这些 csi-users 创建新的 csi-users 和新的 secret。

        带有受限身份验证权限的示例:

        # python3 /etc/ceph/create-external-cluster-resources.py --cephfs-filesystem-name myfs --rbd-data-pool-name replicapool --cluster-name rookStorage --restricted-auth-permission true
        Copy to Clipboard Toggle word wrap

        使用 python 脚本生成的 JSON 输出示例:

        [{"name": "rook-ceph-mon-endpoints", "kind": "ConfigMap", "data": {"data": "xxx.xxx.xxx.xxx:xxxx", "maxMonId": "0", "mapping": "{}"}}, {"name": "rook-ceph-mon", "kind": "Secret", "data": {"admin-secret": "admin-secret", "fsid": "<fs-id>", "mon-secret": "mon-secret"}}, {"name": "rook-ceph-operator-creds", "kind": "Secret", "data": {"userID": "<user-id>", "userKey": "<user-key>"}}, {"name": "rook-csi-rbd-node", "kind": "Secret", "data": {"userID": "csi-rbd-node", "userKey": "<user-key>"}}, {"name": "ceph-rbd", "kind": "StorageClass", "data": {"pool": "<pool>"}}, {"name": "monitoring-endpoint", "kind": "CephCluster", "data": {"MonitoringEndpoint": "xxx.xxx.xxx.xxx", "MonitoringPort": "xxxx"}}, {"name": "rook-ceph-dashboard-link", "kind": "Secret", "data": {"userID": "ceph-dashboard-link", "userKey": "<user-key>"}}, {"name": "rook-csi-rbd-provisioner", "kind": "Secret", "data": {"userID": "csi-rbd-provisioner", "userKey": "<user-key>"}}, {"name": "rook-csi-cephfs-provisioner", "kind": "Secret", "data": {"adminID": "csi-cephfs-provisioner", "adminKey": "<admin-key>"}}, {"name": "rook-csi-cephfs-node", "kind": "Secret", "data": {"adminID": "csi-cephfs-node", "adminKey": "<admin-key>"}}, {"name": "cephfs", "kind": "StorageClass", "data": {"fsName": "cephfs", "pool": "cephfs_data"}}, {"name": "ceph-rgw", "kind": "StorageClass", "data": {"endpoint": "xxx.xxx.xxx.xxx:xxxx", "poolPrefix": "default"}}, {"name": "rgw-admin-ops-user", "kind": "Secret", "data": {"accessKey": "<access-key>", "secretKey": "<secret-key>"}}]
        Copy to Clipboard Toggle word wrap

      3. 将 JSON 输出保存到带有 .json 扩展名的文件

        注意

        要使 OpenShift Data Foundation 无缝工作,请确保使用 JSON 文件上传的参数(RGW 端点、CephFS 详细信息和 RBD 池等)在创建存储集群后在 RHCS 外部集群上保持不变。

      4. 在多租户部署中的 RHCS 集群已连接到带有较低版本的 OpenShift Data Foundation 部署时,运行命令。

        # python3 ceph-external-cluster-details-exporter.py --upgrade
        Copy to Clipboard Toggle word wrap
    3. 单击 Browse 以选择并上传 JSON 文件。

      JSON 文件的内容填充并在文本框中显示。

    4. Next

      只有上传 .json 文件后,Next 按钮才会启用。

  5. 在 Review and create 页面中,检查所有详情是否正确:

    • 若要修改任何配置设置,请单击 Back 以返回到上一配置页面。
  6. 单击 Create StorageSystem

验证步骤

验证已安装存储集群的最终状态:

  1. 在 OpenShift Web 控制台中,导航到 Installed Operators OpenShift Data Foundation Storage System ocs-external-storagecluster-storagesystem Resources
  2. 验证 StorageClusterStatus 是否为 Ready 且具有绿色勾号。
  3. 要验证 OpenShift Data Foundation、Pod 和 StorageClass 是否已成功安装,请参阅验证外部 Ceph 存储系统的 OpenShift Data Foundation 安装模式
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat