Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Apache Kafka MirrorMaker Invocation

From Leeroopedia
Revision as of 17:32, 16 February 2026 by Admin (talk | contribs) (Auto-imported from principles/Apache_Kafka_MirrorMaker_Invocation.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Knowledge Sources
Domains Kafka_Connect, Replication, Disaster_Recovery
Last Updated 2026-02-09 12:00 GMT

Overview

Principle for launching MirrorMaker 2 (MM2) to replicate data between Kafka clusters for geo-replication, disaster recovery, and data migration.

Description

MirrorMaker Invocation is the principle of starting the MirrorMaker 2 replication engine, which is built on top of the Kafka Connect framework. MM2 provides automated, continuous replication of topics, consumer group offsets, and ACLs between Kafka clusters. It supports complex multi-cluster topologies including active-passive (disaster recovery), active-active (geo-replication), and fan-out patterns.

MM2 replaces the legacy MirrorMaker 1 tool and introduces key improvements: automatic topic creation on the target cluster, consumer group offset translation for failover, and configurable replication policies for topic naming and filtering.

Usage

Use this principle when data needs to be replicated between Kafka clusters for disaster recovery, geo-replication across data centers, cloud migration, or aggregating data from multiple regional clusters into a central analytics cluster.

Theoretical Basis

MirrorMaker 2 implements a source connector pattern using three specialized connectors:

Pseudo-code Logic:

# Abstract algorithm description (NOT real implementation)
mm2 = MirrorMaker(mm2_properties)

# Three internal connectors are created:
mirror_source = MirrorSourceConnector()   # Replicates topic data
mirror_checkpoint = MirrorCheckpointConnector()  # Syncs consumer offsets
mirror_heartbeat = MirrorHeartbeatConnector()    # Monitors replication liveness

# Topics on source are mirrored with naming convention:
# source_cluster_alias.original_topic_name
# Consumer offsets are translated for seamless failover

The replication is asynchronous with configurable sync intervals. Topic naming follows the convention source_alias.topic_name to avoid conflicts, with configurable ReplicationPolicy for custom naming.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment