---
title: "KIP-382 explained: MirrorMaker 2 for Kafka replication"
description: "KIP-382 in plain words: how MirrorMaker 2 copies topics, configs and consumer offsets between Kafka clusters on Kafka Connect, and why the offsets differ."
url: https://monedula.dev/kafka/kips/kip-382/
---

# 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.

## At a glance

- 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
- Proposal page: [KIP-382 on the Apache Kafka wiki](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)

## 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

- [MirrorMaker 2 offset translation for Kafka consumer failover](https://monedula.dev/kafka-simulator/scenarios/offset-translation-checkpoint/) (Offset translation across clusters), step 4: 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 at this step](https://monedula.dev/kafka-simulator/playground/?scenario=18.2.4&t=3)
- [Kafka MirrorMaker 2 active-passive DR and replication lag](https://monedula.dev/kafka-simulator/scenarios/dr-mirror/) (Active-passive mirror), step 4: Mirror caught up - dr holds all three (lag 0). MM2 has copied all three records into primary.orders (dr HW 3), with source offsets 0, 1, 2 mapped one-to-one. Lag is 0, so a failover at this moment would lose nothing. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=18.2.1&t=3)
- [Confluent Cluster Linking: offset-preserving Kafka mirroring](https://monedula.dev/kafka-simulator/scenarios/cluster-linking-offset-preserving/) (Cluster Linking: byte-for-byte offset-preserving mirror), step 2: Offsets preserved (cluster link) vs translated (MM2). Both destinations now hold 3 records. The cluster link copied orders byte-for-byte: orders on dr has offsets == source offsets, and the link carries NO offsetMap. MM2 re-produced payments and built an offsetMap translation table on mm-payments - same numbers here, but it is the machinery cluster linking avoids. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=20.1.1&t=1)

## Sources

- [KIP-382: MirrorMaker 2.0](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
- [KIP-545: support automated consumer offset sync across clusters in MM 2.0](https://cwiki.apache.org/confluence/display/KAFKA/KIP-545%3A+support+automated+consumer+offset+sync+across+clusters+in+MM+2.0)

## Related KIPs

- [KIP-1279 explained: Apache Kafka Cluster Mirroring](https://monedula.dev/kafka/kips/kip-1279/)
- [KIP-545 explained: MirrorMaker 2 consumer offset sync](https://monedula.dev/kafka/kips/kip-545/)
