Monedula
Kafka Simulator docs menu

Run an active/passive pair and fail over

Start the two-region active/passive sandbox, watch the mirror copy records to the DR region, take the primary region down and fail over.

How-to guides 3 of 10

3 min read

Updated 13 October 2026

Markdown

On this page

The Active / passive (mirror) sandbox models two regions, each its own Kafka cluster: primary takes the writes and dr holds a mirror copy.

Steps

1. Start the sandbox

In the left rail of the playground, set cluster type to Active / passive (mirror). On a narrow screen, pick it from the scenario menu in the top bar, under ✦ Free play. The sandbox starts with:

  • two regions, primary with broker-1 and broker-2, and dr with broker-3 and broker-4, each region with its own three-voter KRaft quorum;
  • the topic orders in primary, with one partition and replication factor 2;
  • a mirror link, mm-1, that copies orders from primary to dr, where it arrives as primary.orders;
  • the producer p1 and the consumer group cg1, on orders.

2. Watch the mirror

Select the arrow between the two regions. The Inspector opens on Mirror link · mm-1: its kind, MirrorMaker 2 (re-produces), its direction, the destination topic, and for each partition the source high watermark (src HW), the last mirrored offset and the lag between them. The copy trails the source by a short delay, so the lag rises while records flow and falls back as they arrive in dr.

Below that, the failover (dr) section shows the rpo, in records not yet mirrored.

The Why tab ends with a DR posture card. For this sandbox it reads “Active-passive · async mirror”, with the RPO in records and the RTO as “manual failover”.

3. Take the primary region down

Select the primary region band. The Inspector opens on Region · primary, with its brokers and topics. Select kill · hard primary: every broker and controller in the region goes down, and the producer can no longer write.

4. Fail over

Select the mirror link again and, under failover (dr), select fail over to dr. The dr region becomes the primary: the producer writes to primary.orders in dr, and the consumer group resumes there. The rpo row now counts the records as lost, never mirrored, and the DR posture card notes the failover and how many records were lost. The mirror link now offers fail back to primary in place of fail over to dr.

5. Fail back

Select the primary region band and restart primary. Then, on the mirror link, select fail back to primary. The original region is the primary again and forward mirroring resumes.

The Failure tab has the same controls in its Failover (DR) section, plus two ways to widen the loss window before you fail over: cut inter-region link under Inter-region link, and the replication speed buttons, normal, slow, very slow and stopped, which throttle the mirror. kill active DC · primary takes the active region down from there too.

In the terminal, each broker belongs to its region’s cluster. On broker-1, kafka-topics --list prints orders; after ssh broker-3 it prints primary.orders, and cluster-info names the region.