---
title: "Kafka cluster failover: active-passive, step by step"
description: "How to fail a Kafka cluster over to its standby: what the standby needs, measuring RPO, moving clients and consumer groups, switchover and failback."
url: https://monedula.dev/kafka/multi-dc/active-passive/
---

# Active-passive: failing over to the standby cluster

Checked against its sources on 28 November 2026.

In active-passive, one Kafka cluster takes all the traffic and a mirror copies its topics to a standby cluster asynchronously. Failing over means making the standby’s copies writable where the tool requires it, giving each consumer group a position there, and pointing every client at the standby’s bootstrap address. The records the mirror had not copied are not on the standby, so the RPO is the mirror’s lag at that moment; they can only be recovered from the primary, if it comes back.

## What the standby needs before the outage

A client on the standby needs more than the records. It needs the topics with their configs, ACLs that let it in, and, for a consumer that should resume where it stopped, a committed offset. Each tool keeps a different part of that in step, and what it leaves out has to be on the standby before the primary fails.

MirrorMaker 2 replicates topic configurations and ACLs as well as records, and detects new topics and partitions. Topic configs and topic ACLs are synced by default (`sync.topic.configs.enabled`, `sync.topic.acls.enabled`), and the topic list and topic configs are refreshed every 600 seconds by default (`refresh.topics.interval.seconds`, `sync.topic.configs.interval.seconds`), so a topic created minutes before the outage may not be on the standby yet. Consumer group offsets reach the standby’s `__consumer_offsets` only with `sync.group.offsets.enabled=true`, which is off by default. Each copy is named after its source cluster by default: `orders` from the cluster aliased `primary` becomes `primary.orders`.

Cluster Linking mirror topics are byte-for-byte copies at the same offsets, and a mirror topic syncs many of its configs from its source, though Confluent’s Cloud docs name the schema validation properties, `confluent.key.schema.validation` and `confluent.value.schema.validation`, as not replicated (their example syncs configs every second, `topic.config.sync.ms=1000`). It can sync ACLs and consumer group offsets too, but both are off by default (`acl.sync.enable`, `consumer.offset.sync.enable`). Confluent’s Cloud docs name what no setting covers: cluster-scoped API keys and RBAC role bindings are not synced, and Cluster Linking does not keep cluster configurations aligned.

Confluent Replicator translates consumer offsets by timestamp, and only if that was planned from the start: every consumer on the primary needs an extra interceptor from its first deployment, translation works for Java consumers only, the interceptor does not support transactions, and `offset.topic.commit` must stay `true`, its default. Replicator writes the translated offsets on the standby while no consumer of the group is connected there.

- Simulator: [Cluster Linking vs MirrorMaker 2: when to use which](https://monedula.dev/kafka-simulator/scenarios/cluster-linking-vs-mm2/): A cluster link and MirrorMaker 2 side by side: the link’s mirror keeps the topic name and the offsets, MirrorMaker 2’s copy is renamed and needs an offset map.

## Know your RPO before you need it

Failing over leaves behind whatever the mirror had not copied, so the RPO you get is the mirror’s lag at the moment the primary fails. It is a number to measure, at peak write load and while the link between sites is slow, not a setting to choose.

MirrorMaker 2’s closest signals are on its source connector: `replication-latency-ms`, the time records take to propagate from source to target, and `record-age-ms`, the age of records when they are replicated, each with min, max and avg variants. Both time the records that did cross, not a count of those still waiting, so they show how far behind the mirror runs rather than the RPO itself. On its checkpoint connector, `checkpoint-latency-ms` is the time consumer offsets take. In Confluent Cloud, `confluent kafka mirror describe` shows a mirror topic’s lag per partition, and `MaxLag` is the largest lag, in messages, among the mirrored partitions.

- Simulator: [Active-passive mirror](https://monedula.dev/kafka-simulator/scenarios/dr-mirror/): A MirrorMaker 2 mirror copies `orders` to the standby; cut the link between regions and the lag grows while the primary keeps taking writes.

## Failing over after the primary is lost

A client stays with the cluster its bootstrap address leads to. `bootstrap.servers` lists the brokers a client uses for its initial connection to a cluster, and it discovers the rest of that cluster’s brokers from them, so moving clients to the standby means pointing that address at the standby’s brokers. For a manual switchover, Confluent’s Cloud docs ask for clients built to update their bootstrap configuration and restart during a failover, and name DNS updates, load balancers or configuration changes as the ways to do it; its Replicator docs say consumers must restart to connect to the new cluster. Confluent Cloud’s Automatic Failover, in limited availability, uses a single global bootstrap URL instead.

With Cluster Linking the mirror topics are read-only until mirroring stops. `confluent kafka mirror failover` on the standby converts each one into a regular, writable topic whatever the lag and whether or not the primary is reachable, and mirroring of that topic ends; `truncate-and-restore`, on a bidirectional link in KRaft mode, can turn it back into a mirror. With MirrorMaker 2 nothing is converted: the copy is an ordinary topic under its prefixed name. That naming exists so that records from different clusters are not written to the same topic-partition, so writes taken on the standby belong in a topic of its own, not in `primary.orders`.

Each consumer group then needs a position on the standby. With Cluster Linking’s offset sync on, offsets are the same on both clusters and a group resumes at its last synced commit, reset to the mirror’s log end offset if the commit lies beyond it. With MirrorMaker 2 it resumes at its last checkpoint, if `sync.group.offsets.enabled` wrote it to the standby, which it does only while no consumer of the group is connected there, or if the application seeks to the translated offsets itself (`RemoteClusterUtils.translateOffsets`). With Replicator, a restarted consumer finds the translated offsets through the normal committed-offset lookup. A group without any of these starts where its `auto.offset.reset` says. Commits made after the last sync or checkpoint are usually read again; the consumer offsets page in this area works through where each tool resumes.

- Simulator: [Failover + RPO](https://monedula.dev/kafka-simulator/scenarios/dr-failover/): Cut the link, keep producing, fail over: the records written after the cut never reach the standby, and their count is the RPO.
- Simulator: [Offset translation across clusters](https://monedula.dev/kafka-simulator/scenarios/offset-translation-checkpoint/): MirrorMaker 2 checkpoints the group; fail over between checkpoints and it rereads the records committed since the last one.
- Simulator: [Mirror topics are read-only; promotion makes them writable](https://monedula.dev/kafka-simulator/scenarios/mirror-read-only-promote-writable/): A Cluster Linking mirror topic takes writes only from the link until it is promoted; then a producer on the standby can append.

## Planned switchover without losing records

When both clusters are up, for a migration, maintenance or a drill, the move can lose nothing. Stop the producers on the primary, let the mirror and the offset sync catch up to zero lag, move the consumers, then start the producers against the standby. With nothing new written and nothing left to copy, every acknowledged record is on the standby before a client reads there.

With Cluster Linking, `promote` checks the zero-lag part for you: it checks that there is no mirroring lag, config sync lag or consumer offset lag, and needs the primary online. It does not stop producers or move clients. Confluent describes it as the option often used for migrations, and `failover` as the one for when a disaster has hit the source. The MirrorMaker 2 and Replicator docs read for this page describe no such check, so confirming that the copy and the group offsets have caught up is the operator’s step.

- Simulator: [Bidirectional links and clean failback](https://monedula.dev/kafka-simulator/scenarios/bidirectional-links-failback/): Switch over to the mirror, produce there and switch back: the link reverses in place and both clusters keep the same offsets.

## Failing back

Failing back is a switchover in the other direction, with a problem the first move did not have: the old primary may hold records the mirror never copied, and the standby has taken writes the old primary never saw.

Cluster Linking fails back on a bidirectional link without a topic prefix, in KRaft mode. `truncate-and-restore` on the old primary’s topics deletes the records written there after the failover point and turns them into mirrors of the standby. The link on the original cluster then needs `LOCAL_MIRROR` offset sync enabled, and once every consumer group has moved back, `reverse-and-start` on those mirror topics restores the original direction. Confluent’s steps also shut the clients down and restart them against the original primary. Replicator’s docs bring a recovered primary up to date by running Replicator in the primary cluster. The Apache Kafka docs describe no failback procedure for MirrorMaker 2; under its default naming the standby’s own topic reaches the primary as another prefixed topic, not as `orders`.

The records the old primary held and never copied are not in the standby’s history unless you recover them before failing back. Cluster Linking’s `truncate-and-restore` deletes them, and Confluent describes recovering that lagged data first; Replicator’s docs suggest briefly running Replicator from the primary to the secondary to copy them, if their order does not matter. The consumer offsets page in this area follows those records through every tool.

- Simulator: [Failback after the primary recovers](https://monedula.dev/kafka-simulator/scenarios/failback-after-primary-recovers/): Fail over, write on the standby, fail back: the simulator re-syncs those writes to the recovered primary, and its conclusion says why real MirrorMaker 2 has no failback action.
- Simulator: [Cluster Mirroring: stop and fail back](https://monedula.dev/kafka-simulator/scenarios/cluster-mirroring-stop-failback/): KIP-1279’s stop and reverse mirror: failback truncates the old primary to the stop point.

## Sources

- [Apache Kafka 4.3 docs, Geo-Replication (Cross-Cluster Data Mirroring)](https://kafka.apache.org/43/operations/geo-replication-cross-cluster-data-mirroring/)
- [Apache Kafka 4.3 docs, MirrorMaker configs](https://kafka.apache.org/43/configuration/mirrormaker-configs/#mirror_checkpoint_emit.checkpoints.interval.seconds)
- [KIP-382: MirrorMaker 2.0](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
- [Confluent Platform docs, Cluster Linking mirror topics](https://docs.confluent.io/platform/current/multi-dc-deployments/cluster-linking/mirror-topics-cp.html)
- [Confluent Cloud docs, Cluster Linking disaster recovery and failover](https://docs.confluent.io/cloud/current/multi-cloud/cluster-linking/dr-failover.html)
- [Confluent Cloud docs, Cluster Linking manual switchover for active-passive DR](https://docs.confluent.io/cloud/current/multi-cloud/cluster-linking/dr-manual-switch-active-passive.html)
- [Confluent Platform docs, Replicator failover and consumer offset translation](https://docs.confluent.io/platform/current/multi-dc-deployments/replicator/replicator-failover.html)
- [Apache Kafka 4.3 docs, producer config bootstrap.servers](https://kafka.apache.org/43/configuration/producer-configs/#producerconfigs_bootstrap.servers)

## Changes to this page

- 28 November 2026: First published: what the standby needs, measuring RPO, failing over, a planned switchover and failing back.
