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.
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,
primarywithbroker-1andbroker-2, anddrwithbroker-3andbroker-4, each region with its own three-voter KRaft quorum; - the topic
ordersinprimary, with one partition and replication factor 2; - a mirror link,
mm-1, that copiesordersfromprimarytodr, where it arrives asprimary.orders; - the producer
p1and the consumer groupcg1, onorders.
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.
Related
- Share a session as a link keeps the failover you just ran.
- Run an active/active pair has both regions take writes, with no standby to promote.
- The Active-passive mirror, Failover + RPO and Failback after the primary recovers scenario pages walk through the same steps as scripted scenarios.
- Mirror between regions renames the regions and switches the link to Cluster Linking.