Ceph 创建池/Crush 映射 max_size

Ceph 创建池/Crush 映射 max_size

我有默认的存储桶类型

type 0 osd
type 1 host
...
type 10 root

和三个主机存储桶:

host cluster01a {
id -2       # do not change unnecessarily
# weight 1.607
alg straw
hash 0  # rjenkins1
item osd.0 weight 0.268
item osd.1 weight 0.268
item osd.2 weight 0.268
item osd.3 weight 0.268
item osd.4 weight 0.268
item osd.5 weight 0.268
}

host cluster01b {
id -3       # do not change unnecessarily
# weight 1.607
alg straw
hash 0  # rjenkins1
item osd.6 weight 0.268
item osd.7 weight 0.268
item osd.8 weight 0.268
item osd.9 weight 0.268
item osd.10 weight 0.268
item osd.11 weight 0.268
}

host cluster01c {
id -4       # do not change unnecessarily
# weight 1.607
alg straw
hash 0  # rjenkins1
item osd.12 weight 0.268
item osd.13 weight 0.268
item osd.14 weight 0.268
item osd.15 weight 0.268
item osd.16 weight 0.268
item osd.17 weight 0.268
}

和一桶型根

root default {
id -1       # do not change unnecessarily
# weight 4.820
alg straw
hash 0  # rjenkins1
item cluster01a weight 1.607
item cluster01b weight 1.607
item cluster01c weight 1.607
}

和这个规则

rule replicated_ruleset {
ruleset 0
type replicated
min_size 1
max_size 10
step take default
step chooseleaf firstn 0 type host
step emit
}
rule replicated_ruleset_over2hosts {
ruleset 1
type replicated
min_size 2
max_size 2
step take default
step chooseleaf firstn 2 type host
step emit

为什么我会收到错误:

$ceph osd pool create 2hostspool 512 512 replicated replicated_ruleset_over2hosts
Error EINVAL: pool size is bigger than the crush rule max size

min_size:如果池创建的副本数少于此数量,CRUSH 将不是选择该规则。 max_size:如果池创建的副本数量超过此数量,CRUSH 将不是选择该规则。

来源:http://docs.ceph.com/docs/mimic/rados/operations/crush-map-edits/

答案1

你的默认池大小可能是 3(甚至更高?)。您可以通过以下方式获得:

host:~ # ceph daemon mon.<MON> config show | grep osd_pool_default_size
    "osd_pool_default_size": "3",

并根据您的规则更改:

host:~ # ceph daemon mon.<MON> config set osd_pool_default_size 2
{
    "success": "osd_pool_default_size = '2' (not observed, change may require restart) "
}

应在 /etc/ceph/ceph.conf 中配置默认​​池大小的永久更改

相关内容