On this page
Kafka guide · Multi-DC and DR
Active-passive: failing over to the standby cluster
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.
In the simulator
- Cluster Linking vs MirrorMaker 2: when to use whichA 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.
In the simulator
- Active-passive mirrorA MirrorMaker 2 mirror copies
ordersto 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.
In the simulator
- Failover + RPOCut the link, keep producing, fail over: the records written after the cut never reach the standby, and their count is the RPO.
- Offset translation across clustersMirrorMaker 2 checkpoints the group; fail over between checkpoints and it rereads the records committed since the last one.
- Mirror topics are read-only; promotion makes them writableA 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.
In the simulator
- Bidirectional links and clean failbackSwitch 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.
In the simulator
- Failback after the primary recoversFail 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.
- Cluster Mirroring: stop and fail backKIP-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)
- Apache Kafka 4.3 docs, MirrorMaker configs
- KIP-382: MirrorMaker 2.0
- Confluent Platform docs, Cluster Linking mirror topics
- Confluent Cloud docs, Cluster Linking disaster recovery and failover
- Confluent Cloud docs, Cluster Linking manual switchover for active-passive DR
- Confluent Platform docs, Replicator failover and consumer offset translation
- Apache Kafka 4.3 docs, producer config bootstrap.servers
Changes to this page
- First published: what the standby needs, measuring RPO, failing over, a planned switchover and failing back.