Kafka Simulator docs menu
Run an active/active pair
Start the two-region active/active sandbox, where both regions take writes and mirror to each other, then lose one region and watch the other carry on.
On this page
Steps
1. Start the sandbox
In the left rail of the playground, set cluster type to Active / active. On a narrow screen, pick it from the scenario menu in the top bar, under ✦ Free play. The sandbox starts with:
- two regions,
westwithbroker-1andbroker-2, andeastwithbroker-3andbroker-4, each region with its own three-voter KRaft quorum; - a topic owned by each region,
west.ordersandeast.orders, and a mirror link each way that copies it to the other region under the same name; - a producer per region:
pwwrites towest.ordersandpetoeast.orders; - a consumer group per region,
cg1inwestandcg2ineast, each reading both topics in its own region.
2. Read the two mirrors
Select either arrow between the regions. The Inspector opens on that mirror link, for example Mirror link · mm-west-east, with its kind, direction, destination topic and per-partition lag. Neither link has a failover section, because neither region is a standby.
The Why tab ends with a DR posture card. Here it reads “Active-active · bidirectional mirror”, with the RPO as the mirror lag in each direction and the RTO as “≈ 0”.
3. Lose one region
Select the west region band and kill · hard west. The producer pw can no longer write, while pe keeps writing to east.orders and cg2 keeps reading in east: select pe and it keeps getting acknowledgements, while pw reports an error. The records west took but had not mirrored are the loss window, the RPO the DR posture card reported, and the card still reads “≈ 0” for the RTO.
Losing a region is half of a failover. Active-active has no standby to promote, because east already takes its own writes, so the other half is moving west’s clients to east. Select the Failure tab: on this sandbox it has a DR drill (active-active) section with a row per region. Select lose west, which takes down the same brokers and KRaft voters as the kill above, then move west clients to east:
pwreconnects toeastas a new producer session, with a new producer ID.west.ordersis a read-only mirror ineast, sopwnow writeseast.orders, next tope.cg1moves toeastand reads both topics there. On the mirror ofwest.ordersit resumes at its committed offset translated by MirrorMaker 2, capped at what the mirror holds, so the recordswestnever mirrored are skipped. Oneast.ordersit keeps the same offset.
The west row is tagged clients on east, and in the Failover (DR) section the west → east row names the records lost with west and the offset the moved group resumes at. The DR posture card says the same. With an offset checkpoint (ms) set in the timing settings, cg1 resumes at MirrorMaker 2’s last checkpoint of its offset instead, which can trail its last commit, and the row counts the records it reads again.
4. Bring it back
Select the west region band again and restart west. Its brokers and controllers come back, and the mirror from east copies the records west missed while it was down.
west comes back with its disks, so the mirror into east also copies the records it had not mirrored before the loss: they reach east late rather than never. A group that read them in west before the loss and now reads the east mirror reads them a second time. If west had not come back, those records would be gone.
To finish the drill, select move west clients back in the DR drill (active-active) section. pw reconnects to west as a new session and writes west.orders again, and cg1 moves home, carrying its positions back. Wait for the mirror into west to catch up first: a position is capped at what west’s copy holds, so moving back early makes cg1 read the gap again. pe and cg2 never moved.
The Failure tab’s Inter-region link section cuts the link between the regions with cut inter-region link and restores it with heal, and its replication speed buttons throttle both mirrors. It has no fail over button for this sandbox, for the same reason the mirror links have no failover section: neither region is a standby to promote.
In the terminal, each broker answers for its own region’s cluster: kafka-topics --list on broker-1 prints east.orders and west.orders, both held in west, and kafka-consumer-groups --list after ssh broker-3 prints only g2, the canvas’s cg2.
Related
- Run an active/passive pair and fail over is the standby model, with a failover and a failback.
- Features by release lists the free-play topologies this release offers.
- The Active-active multi-cluster scenario page walks through the same design as a scripted scenario.
- The Active-active DR drill scenario page walks through steps 3 and 4 as a scripted scenario: lose
west, move its clients toeast, restartwestand move them back.