Chapter 6. About MirrorMaker 2


Kafka MirrorMaker 2 replicates data (topics, consumer groups, and offsets) between Kafka clusters. Through configuration, you define source and target cluster connections. You can use MirrorMaker 2 in active/passive or active/active cluster configurations.

active/active cluster configuration
An active/active configuration has two active clusters replicating data bidirectionally. Applications can use either cluster. Each cluster can provide the same data. In this way, you can make the same data available in different geographical locations. As consumer groups are active in both clusters, consumer offsets for replicated topics are not synchronized back to the source cluster.
active/passive cluster configuration
An active/passive configuration has an active cluster replicating data to a passive cluster. The passive cluster remains on standby. You might use the passive cluster for data recovery in the event of system failure.

The expectation is that producers and consumers connect to active clusters only. A MirrorMaker 2 cluster is required at each target destination.

Note

In most deployments, write operations should be made only to source topics. Write operations on target topics are not prevented, but they can cause conflicts and should be avoided.

6.1. Bidirectional replication (active/active)

The MirrorMaker 2 architecture supports bidirectional replication in an active/active cluster configuration.

Each cluster replicates the other’s data using the concept of source and remote topics. In this context, remote refers to the target cluster receiving replicated data from the perspective of the source MirrorMaker instance. Each cluster simultaneously acts as both source and remote, depending on the direction of the replication flow.

As the same topics are stored in each cluster, remote topics are automatically renamed by MirrorMaker 2 to indicate their origin. The name of the source cluster is prepended to the topic name.

Figure 6.1. Topic renaming

This renaming prevents topics from being replicated back to their originating cluster.

This replication structure also supports data aggregation in active/active setups: Consumers can subscribe to both source and remote topics within the same cluster, eliminating the need for a separate aggregation cluster.

6.2. Unidirectional replication (active/passive)

The MirrorMaker 2 architecture supports unidirectional replication in an active/passive cluster configuration.

You can use an active/passive cluster configuration to make backups or migrate data to another cluster. In this situation, you might not want automatic renaming of remote topics.

You can override automatic renaming by adding IdentityReplicationPolicy to the source connector configuration. With this configuration applied, topics retain their original names.

Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top