CephNotes

Some notes about Ceph
Laurent Barbe @CCM Benchmark

Crushmap for 2 DC

An example of crushmap for 2 Datacenter replication :

rule replicated_ruleset {
    ruleset X
    type replicated
    min_size 2
    max_size 3
    step take default
    step choose firstn 2 type datacenter
    step chooseleaf firstn -1 type host
    step emit
}

This working well with pool size=2 (not recommended!) or 3. If you set pool size more than 3 (and increase the max_size in crush), be careful : you will have n-1 replica on one side and only one on the other datacenter.

If you want to be able to write data even when one of the datacenters is inaccessible, pool min_size should be set at 1 even if size is set to 3. In this case, pay attention to the monitors location.

Other posts about crushmap : http://cephnotes.ksperis.com/blog/categories/crushmap/

Comments