Make sure the Ceph pool replicates data across hosts instead of only OSDs.
Description
Description
Status | Assigned | Task | ||
---|---|---|---|---|
Migrated | gitlab-migration | T2501 Proxmox reliability improvements (Summer 2020) | ||
Migrated | gitlab-migration | T2502 Migrate VM storage to ceph | ||
Migrated | gitlab-migration | T2503 Set up hyperconverged ceph cluster | ||
Migrated | gitlab-migration | T2508 Update Ceph pool to use the default CRUSH replication rule | ||
Migrated | gitlab-migration | T2504 Add hypervisor3 ssds as Ceph OSDs | ||
Migrated | gitlab-migration | T2505 Migrate hypervisor3 vms to (temporary) ceph pool | ||
Migrated | gitlab-migration | T2507 Set up temporary (single-host) ceph pool | ||
Migrated | gitlab-migration | T2506 Add new beaubourg SSDs as Ceph OSDs |
Event Timeline
Comment Actions
The current setup (with only two hosts with OSDs) can't support three replicas using the default replication rule, which separates copies so they're on different hosts.
The temporary "single host" crush rule would allow all three copies of an object to be on the same host, which is not okay either.
Inspired by this ceph-users thread: http://lists.ceph.com/pipermail/ceph-users-ceph.com/2015-April/000599.html, we created a custom rule which:
- allows 3 replicas
- makes sure the 3 replicas are split across 2 hosts
Dump and decompile the current crushmap
sudo ceph osd getcrushmap -o crushmap.orig crushtool -d crushmap.orig -o crushmap.orig.plain
Create the new crushmap
cp crushmap.orig.plain crushmap.new.plain edit crushmap.new.plain
Insert the new rule
rule two_hosts_rule { id 2 type replicated min_size 1 max_size 10 step take default step choose firstn 2 type host step chooseleaf firstn 2 type osd step emit }
Compile and load the new crushmap
crushtool -c crushmap.new.plain -o crushmap.new sudo ceph osd setcrushmap -i crushmap.new
Comment Actions
Now that we have three hosts, the following command has been run to restore replication across all three hosts:
$ sudo ceph osd pool set proxmox crush_rule replicated_rule set pool 1 crush_rule to replicated_rule