Monedula
Kafka guide contents

Markdown

Part VI · Reference

Kafka Improvement Proposal

KIP-382: MirrorMaker 2, replication between Kafka clusters

Across clusters · Shipped · since Kafka 2.4 · status checked November 2026

KIP-382 is MirrorMaker 2, the tool Apache Kafka ships for copying data between clusters, for disaster recovery or for moving data between regions. It runs on Kafka Connect, copies topics with their configs, and translates consumer group offsets, because a record lands at a different offset in the target cluster than in the source.

Proposal
KIP-382, MirrorMaker 2.0
Status
Shipped Since Kafka 2.4 (2019); the original MirrorMaker was removed in Kafka 4.0.
Area
Across clusters
Failover: consumer resumes at the checkpoint (offset 3), not 5. g1 is promoted onto dr's primary.orders. Offset translation resumes it at the last checkpointed offset (3), NOT its live committed (5) - so records 3,4 will be reprocessed. RPO is still 0 (all data mirrored); the only cost is reprocessing the un-checkpointed tail. Open this step in the full playground

Why it was needed

The original MirrorMaker was a consumer glued to a producer. It copied records and nothing else: no topic configs, no new partitions, no consumer offsets, and no protection against copying a topic back and forth in a loop. Failing a consumer over to the other cluster meant guessing where to start.

What it changes

MirrorMaker 2 is a set of Kafka Connect connectors. MirrorSourceConnector consumes from the source and produces to the target, under a prefixed name by default (orders becomes primary.orders), which also prevents loops. It writes offset syncs as it goes, and MirrorCheckpointConnector uses them to translate committed consumer offsets into checkpoints on the target. Since the target offsets are produced anew, the translation is approximate: after a failover a consumer may re-read a few records.

How to use it

  • Run connect-mirror-maker.sh with a properties file naming the clusters and the flows, such as primary->dr.enabled=true, or deploy the connectors on an existing Connect cluster.
  • Set sync.group.offsets.enabled=true (KIP-545) so translated offsets are written to the target groups and consumers can fail over without tooling.

Where it stands

Shipped in Kafka 2.4 and the standard open-source way to mirror Kafka. KIP-545 (Kafka 2.7) added automatic consumer offset sync. The legacy MirrorMaker 1 was deprecated in 3.0 and removed in Kafka 4.0.

What comes next

MirrorMaker 2 stays. KIP-1280 deprecated its current metrics in Kafka 4.3, to be replaced and removed in 5.0. Apache Kafka is also getting a second approach: Cluster Mirroring (KIP-1279, accepted in September 2026) copies the log inside the brokers with the same offsets, the model Confluent Cluster Linking made popular.

See it in the simulator

Sources

All Kafka KIPs