Integration / Apache Kafka Interview questions
How do you configure MirrorMaker for cross-cluster replication?
MirrorMaker (MM2, built on the Kafka Connect framework) continuously replicates topics from a source Kafka cluster to a target cluster, typically for disaster recovery, geo-distribution, or feeding a separate analytics cluster without impacting the primary one.
# mm2.properties clusters=primary, backup primary.bootstrap.servers=primary-broker:9092 backup.bootstrap.servers=backup-broker:9092 primary->backup.enabled=true primary->backup.topics=orders,payments
connect-mirror-maker.sh mm2.properties
Because it's Connect-based, MM2 runs as source connectors (one direction of replication per configured flow) and inherits Connect's scaling, offset-tracking, and fault-tolerance behavior rather than being a bespoke standalone tool. Replicated topics on the target cluster are prefixed by default with the source cluster's alias (e.g. primary.orders) to avoid naming collisions and make the data's origin traceable; MM2 also replicates consumer group offsets via offset translation, which is what allows a consumer application to fail over from the primary cluster to the backup and resume roughly where it left off, rather than starting from scratch.
More Related questions...