1

I have the default bucket types

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

and three host buckets:

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
}

and one bucket type root

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
}

and this rules

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

Why do I get the error:

$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: If a pool makes fewer replicas than this number, CRUSH will NOT select this rule. max_size: If a pool makes more replicas than this number, CRUSH will NOT select this rule.

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

1 Answer 1

1

your default pool size is probably 3 (or even higher?). You can get that with:

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

and change that according to your rule:

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

Permanent changes for default pool sizes should be configured in /etc/ceph/ceph.conf

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .