Skip to main content
RunBook Academy

CephCXIX · Disaster Recovery ArchitectureDisaster Recovery Architecture

Choosing the failure domain a second copy must survive

Advanced⏱ ~18 mincephcrushtool

What you'll learn

  • Enumerate the failure domains a design can span
  • Compare in-cluster, stretch and external architectures
  • Place monitor quorum against the site failure you plan for
  • Identify the failures no in-cluster design survives

Prerequisites

None — start here.

Verified against Ceph Tentacle 20.2.x · Ceph Squid 19.2.x (supported previous) · cephadm matches the verified Ceph release · podman 4.x · csi-rbd and csi-cephfs current · RBD / CephFS / RGW current (matches Ceph release) · Linux kernel 5.15+ (5.10 minimum) · Ubuntu 24.04 LTS (Ceph host baseline) · Debian 12 (Bookworm) (Ceph host baseline) · Rocky Linux / RHEL / AlmaLinux 9.x (Ceph host baseline) · Proxmox VE 9.x (cross-course integration) · Kubernetes 1.31+ (cross-course integration) · 2026-08-18

Not yet marked complete on this device.

Why this matters in production

A copy inside the failure domain you are planning against is not a second copy. Most Ceph DR designs pass the physical test and fail the administrative one.

The domains a design can span

DomainSpanned by
devicereplication or erasure coding
hosta CRUSH rule with a host failure domain
rack, room, power feeda CRUSH rule with that bucket type
datacentrestretch mode, or a second cluster
regiona second cluster, or an offsite copy
administrativeonly a copy outside this cluster’s control plane
ceph osd crush tree
ceph osd crush rule ls
ceph osd crush rule dump replicated_rule
ceph osd crush rule create-replicated rack-rule default rack
ceph osd pool set rbd crush_rule rack-rule
ceph osd pool get rbd crush_rule

What each architecture buys

ArchitectureSurvivesRPORTOCrosses the admin boundary
one cluster, host failure domaindrives, hosts0secondsno
one cluster, rack or room domaina rack, a power feed0secondsno
stretch cluster, two sites plus tiebreakera datacentre0seconds to minutesno
two clusters, asynchronous replicationa datacentre, a clusterminutesminutes to hourspartly
copy to an independently operated targetall of the above, plus mistakeshours to dayshours to daysyes

Stretch mode

rule stretch_rule {
  id 1
  type replicated
  step take default
  step choose firstn 0 type datacenter
  step chooseleaf firstn 2 type host
  step emit
}
ceph osd getcrushmap -o /tmp/cm.bin
crushtool -d /tmp/cm.bin -o /tmp/cm.txt
# add the rule, then compile and load it
crushtool -c /tmp/cm.txt -o /tmp/cm.new
ceph osd setcrushmap -i /tmp/cm.new
ceph mon set_election_strategy connectivity
ceph mon enable_stretch_mode mon.e stretch_rule datacenter
ceph mon dump | grep -iE 'stretch|tiebreaker|election'
ceph osd pool get rbd size       # 4
ceph osd pool get rbd min_size   # 2

Two monitors per site plus a tiebreaker in a third location, two data copies per site, and a documented degradation path — healthy stretch mode, degraded stretch mode while a site is down, recovery stretch mode as it returns.

Where every in-cluster design ends

EventAny CRUSH ruleStretch modeExternal copy
a rack loses powersurvivessurvivessurvives
a datacentre is lostdepends on the rulesurvivessurvives
a pool is deletednonosurvives
a CRUSH edit maps every PG onto one sitenonosurvives
an upgrade corrupts the OSD store formatnonosurvives
ransomware with cluster credentialsnonoif the target is immutable

Quiz

Knowledge check · 4 questions

  1. Q1. Which failure does no in-cluster replication design protect against?

  2. Q2. Placing replicas in two datacentres with a CRUSH rule is enough to survive the loss of one datacentre.

  3. Q3. Choose a DR architecture for a two-site estate.

    A team has two data centres 40 km apart with a 10 ms round trip, three monitors in site A, two in site B, and a rack-level CRUSH rule. They want to survive the loss of either site.

  4. Q4. What does an externally operated copy protect against that stretch mode does not?

Passing score: 75%. Answers are checked in this browser.

Production discipline

Place monitor quorum against the site failure you are planning for before worrying about data placement — a perfect CRUSH rule cannot help a cluster that cannot reach quorum. Keep an external copy alongside any in-cluster design; stretch mode answers site loss and nothing else.

Cross-course references

  • Kubernetes: a multi-zone cluster still has one API server and one blast radius for a bad manifest
  • Linux: redundancy inside a system never protects against the system being told to do the wrong thing