第 4 章 部署 OpenShift Data Foundation 外部存储集群


使用这个流程部署外部存储集群,以添加额外存储或扩展您当前的内部存储集群。

先决条件

  • 以内部模式部署的 OpenShift Data Foundation 集群。
  • 确保 OpenShift Container Platform 和 OpenShift Data Foundation 升级到 4.15 版本。

流程

  1. 在 OpenShift Web 控制台中,导航到 Storage Data Foundation Storage Systems 选项卡
  2. 单击 Create StorageSystem
  3. 在 Backing storage 页面中,默认选择 Connect a external storage platform

    1. 从可用选项中选择 Red Hat Ceph Storage 作为 Storage platform
    2. 点击 Next
  4. 在 Security and Network 页面中,

    1. 可选: 要选择加密,请选中 Enable encryption 复选框。
    2. 在 Connection 部分中,单击 Download Script 链接,以下载用于提取 Ceph 集群详细信息的 python 脚本。
    3. 若要提取 Red Hat Ceph Storage (RHCS)集群详细信息,请使用 admin 密钥 在 Red Hat Ceph Storage 节点上运行下载的 python 脚本。

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

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

        您也可以从 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
    4. 单击 Browse 以选择并上传 JSON 文件。

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

    5. Next 按钮,在上传 .json 文件后启用。
  5. 在 Review and create 页面中,检查配置详情。

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

  6. 单击 Create StorageSystem

验证步骤

  • 导航到 Storage Data Foundation Storage Systems 选项卡,并验证您可以查看所有存储集群。
  • 验证外部 OpenShift Data Foundation 的所有组件是否已成功安装。具体步骤请参阅 验证外部 OpenShift Data Foundation 存储部署。
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat