搜索

第 10 章 使用 Ceph Orchestrator 管理 Ceph 对象网关

download PDF

作为存储管理员,您可以使用命令行界面或使用服务规格部署 Ceph 对象网关。

您还可以配置多站点对象网关,并使用 Ceph 编排器移除 Ceph 对象网关。

Cephadm 将 Ceph 对象网关部署为守护进程的集合,可在多站点部署中管理单集群部署或特定 realm 和 zone。

注意

使用 Cephadm 时,对象网关守护进程使用 monitor 配置数据库而不是 ceph.conf 或命令行来进行配置。如果 client.rgw 部分中还没有该配置,则对象网关守护进程将使用默认设置启动并绑定到端口 80

注意

只有 Ceph 对象网关中创建 bucket 之后,才会创建 .default.rgw.buckets.index 池,而数据上传到 bucket 后才会创建 .default.rgw.buckets.data 池。

本节涵盖了以下管理任务:

先决条件

  • 一个正在运行的 Red Hat Ceph Storage 集群。
  • 所有节点的根级别访问权限。
  • 主机添加到集群中。
  • 所有管理器、监视器和 OSD 都部署在存储集群中。

10.1. 使用命令行界面部署 Ceph 对象网关

利用 Ceph 编排器,您可以在命令行界面中使用 ceph orch 命令部署 Ceph 对象网关。

先决条件

  • 一个正在运行的 Red Hat Ceph Storage 集群。
  • 所有节点的根级别访问权限。
  • 主机添加到集群中。
  • 部署所有管理器、监控器和 OSD 守护进程。

流程

  1. 登录到 Cephadm shell:

    示例

    [root@host01 ~]# cephadm shell

  2. 您可以通过三种不同的方式部署 Ceph 对象网关守护进程:

方法 1

  • 创建 realm、zone group 和 zone,然后将放置规格与主机名搭配使用:

    1. 创建一个域:

      语法

      radosgw-admin realm create --rgw-realm=REALM_NAME --default

      示例

      [ceph: root@host01 /]# radosgw-admin realm create --rgw-realm=test_realm --default

    2. 创建区组:

      语法

      radosgw-admin zonegroup create --rgw-zonegroup=ZONE_GROUP_NAME  --master --default

      示例

      [ceph: root@host01 /]# radosgw-admin zonegroup create --rgw-zonegroup=default  --master --default

    3. 创建区:

      语法

      radosgw-admin zone create --rgw-zonegroup=ZONE_GROUP_NAME --rgw-zone=ZONE_NAME --master --default

      示例

      [ceph: root@host01 /]# radosgw-admin zone create --rgw-zonegroup=default --rgw-zone=test_zone --master --default

    4. 提交更改:

      语法

      radosgw-admin period update --rgw-realm=REALM_NAME --commit

      示例

      [ceph: root@host01 /]# radosgw-admin period update --rgw-realm=test_realm --commit

    5. 运行 ceph orch apply 命令:

      语法

      ceph orch apply rgw NAME [--realm=REALM_NAME] [--zone=ZONE_NAME] --placement="NUMBER_OF_DAEMONS [HOST_NAME_1 HOST_NAME_2]"

      示例

      [ceph: root@host01 /]# ceph orch apply rgw test --realm=test_realm --zone=test_zone --placement="2 host01 host02"

方法 2

  • 使用任意服务名称为单个集群部署部署两个 Ceph 对象网关守护进程:

    语法

    ceph orch apply rgw SERVICE_NAME

    示例

    [ceph: root@host01 /]# ceph orch apply rgw foo

方法 3

  • 在标记的一组主机上使用任意服务名称:

    语法

    ceph orch host label add HOST_NAME_1 LABEL_NAME
    ceph orch host label add HOSTNAME_2 LABEL_NAME
    ceph orch apply rgw SERVICE_NAME --placement="label:LABEL_NAME count-per-host:NUMBER_OF_DAEMONS" --port=8000

    注意

    NUMBER_OF_DAEMONS 控制每个主机上部署的 Ceph 对象网关数量。要在不增加成本的情况下获得最高的性能,请将此值设置为 2。

    示例

    [ceph: root@host01 /]# ceph orch host label add host01 rgw  # the 'rgw' label can be anything
    [ceph: root@host01 /]# ceph orch host label add host02 rgw
    [ceph: root@host01 /]# ceph orch apply rgw foo --placement="2 label:rgw" --port=8000

验证

  • 列出服务:

    示例

    [ceph: root@host01 /]# ceph orch ls

  • 列出主机、守护进程和进程:

    语法

    ceph orch ps --daemon_type=DAEMON_NAME

    示例

    [ceph: root@host01 /]# ceph orch ps --daemon_type=rgw

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.