添加 RGW 实例时的 Ceph 状态 HEALTH_WARN

Ceph status HEALTH_WARN while adding an RGW Instance

我想创建 ceph 集群,然后通过 S3 连接到它 RESTful api。 因此,我已经在 "Ubuntu 16.04.5 LTS" 上部署了 ceph 集群(模拟 13.2.4)和 3 个 OSD(每个 HDD 10Gb 一个)。

使用本教程:

1) http://docs.ceph.com/docs/mimic/start/quick-start-preflight/#ceph-deploy-setup

2) http://docs.ceph.com/docs/mimic/start/quick-ceph-deploy/ 此时ceph状态为OK:

root@ubuntu-srv:/home/slavik/my-cluster# ceph -s
  cluster:
    id:     d7459118-8c16-451d-9774-d09f7a926d0e
    health: HEALTH_OK



  services:
    mon: 1 daemons, quorum ubuntu-srv
    mgr: ubuntu-srv(active)
    osd: 3 osds: 3 up, 3 in

  data:
    pools:   0 pools, 0 pgs
    objects: 0  objects, 0 B
    usage:   3.0 GiB used, 27 GiB / 30 GiB avail
    pgs:

3) "To use the Ceph Object Gateway component of Ceph, you must deploy an instance of RGW. Execute the following to create an new instance of RGW:"

root@ubuntu-srv:/home/slavik/my-cluster# ceph-deploy rgw create ubuntu-srv
....
[ceph_deploy.rgw][INFO  ] The Ceph Object Gateway (RGW) is now running on host ubuntu-srv and default port 7480
root@ubuntu-srv:/home/slavik/my-cluster# ceph -s
  cluster:
    id:     d7459118-8c16-451d-9774-d09f7a926d0e
    health: HEALTH_WARN
            too few PGs per OSD (2 < min 30)

  services:
    mon: 1 daemons, quorum ubuntu-srv
    mgr: ubuntu-srv(active)
    osd: 3 osds: 3 up, 3 in

  data:
    pools:   1 pools, 8 pgs
    objects: 0  objects, 0 B
    usage:   3.0 GiB used, 27 GiB / 30 GiB avail
    pgs:     37.500% pgs unknown
             62.500% pgs not active
             5 creating+peering
             3 unknown

Ceph 状态已更改为 HEALTH_WARN - 为什么以及如何解决?

你的问题是

health: HEALTH_WARN
        too few PGs per OSD (2 < min 30)

通过运行查看您当前的 pg 配置:

ceph osd 转储|grep 池

查看每个池的 pg 计数配置,然后转到 https://ceph.com/pgcalc/ 计算您的池应配置的内容。

警告是每个 osd 的 pg 数量很少,现在每个 osd 有 2 个,其中 min 应该是 30