Geo-replication

  • Trace MirrorMaker across clusters and identify the data and offsets available for a cutover.
100%
East · active KafkaclusterMirrorMaker 2 · ConnectworkersWest · recovery KafkaclusterTwo independent clusters connected by asynchronous mirroringOffsets and cutoverSource recordsCross-cluster copyfetchmirroroffset mappingsgroup progresssync if inactiveverify recovery pointordersEast partition logsfulfillmentEast group offsetsSource connectorCopy recordsCheckpoint connectorTranslate positionseast.ordersWest partition logsfulfillmentTranslated offsetsRelease owner · fence East, verify West, redirect clientsfetchmirroroffset mappingsgroup progresssync if inactiveverify recovery point

Select a component to trace its direct connections. Drag to pan · Ctrl + wheel or pinch to zoom.

  • East and West are independent clusters. MirrorMaker’s source connector copies East orders into West’s east.orders topic after those records are written in East.
  • West assigns its own offsets. For this group, a checkpoint translates East’s next offset 113 into West’s next offset 802.
  • The checkpoint connector can save that position for an inactive West group. At cutover, operators stop East writers and direct clients to West.
  • A record acknowledged in East can still be in transit when East fails. If it already reached West but its checkpoint trails, the consumer may process it twice.
Cross-cluster data mirroring

Cross-cluster data mirroring

Apache Kafka 4.1 · illustrative cluster and offsets

Asynchronous cross-cluster copy

  • East and West are independent Kafka clusters with their own controllers, partitions and local replica policies. An East acknowledgment uses East’s replica contract.
  • In this active/passive design, a MirrorSourceConnector reads East orders and produces West east.orders. The default replication policy prefixes the source alias.
  • MirrorCheckpointConnector translates committed source group offsets using offset-sync mappings. Periodic synchronization can install translated positions for groups with no active consumers in West. The illustrated profile explicitly enables that feature.
One-way MirrorMaker 2 settingsproperties
# Kafka 4.1 MirrorMaker 2 · illustrative one-way disaster recovery profile.
clusters=east,west
east.bootstrap.servers=broker-east.example:9092
west.bootstrap.servers=broker-west.example:9092
east->west.enabled=true
west->east.enabled=false
east->west.topics=orders
east->west.groups=fulfillment
east->west.emit.offset-syncs.enabled=true
east->west.emit.checkpoints.enabled=true
east->west.sync.group.offsets.enabled=true
# Default replication policy creates east.orders in west.
# Target group-offset sync requires the group to be inactive in west.
# Provision Connect storage, authentication, ACLs and replication factors separately.

Exercise the cutover

Test Evidence needed Decision
Healthy East Produce synthetic operation IDs and compare those present in West Estimate per-partition data replication lag and reconcile missing IDs
Offset checkpoint trails data copy Record the translated West position and last completed business IDs Expect replay on restart and verify receiver deduplication
East lost before copying its newest acknowledged records Check West’s last mirrored IDs Quantify loss against the agreed recovery-point objective
East returns after promotion Check producer ownership, outstanding writes and mirroring direction Reconcile diverged work before enabling a reverse flow
  • With 100 produced records/s, a 6 s observed copy delay suggests about 600 records of exposure at that moment under steady load. Outage duration, partition skew, buffering and backlogs can extend it.
  • Suppose a checkpoint reports East next offset 113 and translated West next offset 802. Inspect the operation IDs around West 802 before activating the group. Translation can conservatively replay work. A stable operation ID carried inside the record lets the receiver recognize it even when topic names and offsets change.

Who owns promotion?

  • Fence East writers and retire its consumers as the runbook allows. Verify mirror health, translated group checkpoints, target capacity, ACLs and required topic/configuration compatibility.
  • Start fulfillment in West on east.orders using a verified target offset. East and West offsets can differ. Inspect the actual checkpoint. If no usable checkpoint exists, choose a documented replay point and reconcile the business result.
  • Repoint producers explicitly to the intended writable topic and ensure consumers subscribe to it as well. Writing new records to West orders while consumers read only east.orders splits new traffic from mirrored history.
  • Active/active adds collision, loop-prevention and application conflict decisions. MirrorMaker copies records and metadata. The release owner must arbitrate writers and redirect clients.