{"id":"5b4560b2-7fcc-4ab6-9ca8-012666f702b0","task":"Configure MirrorMaker 2 for active-active bidirectional replication between two Kafka clusters with cycle prevention","domain":"kafka.apache.org","steps":["In mm2.properties define both clusters: clusters = dc1, dc2 with dc1.bootstrap.servers and dc2.bootstrap.servers; enable dc1->dc2 and dc2->dc1 replication flows","Set replication.policy.class=org.apache.kafka.connect.mirror.IdentityReplicationPolicy only if topic namespacing is managed externally; otherwise use DefaultReplicationPolicy which prefixes topics with source cluster alias to prevent cycles","Configure heartbeats.topic.replication.factor=1 and checkpoints.topic.replication.factor=1 for internal MM2 topics; set replication.factor=3 for data topics","Enable offset translation by setting emit.checkpoints.enabled=true and sync.group.offsets.enabled=true so consumers can failover between clusters with accurate positions","Set topics.exclude to block replication of MM2 internal topics (heartbeats, checkpoints, offset-syncs) back across the link","Deploy as a Kafka Connect distributed cluster on each side; monitor lag using the MirrorHeartbeatConnector latency metric"],"gotchas":["With DefaultReplicationPolicy, dc1's 'orders' topic becomes 'dc1.orders' on dc2; applications must be aware of the prefix or use IdentityReplicationPolicy with strict topic naming conventions","sync.group.offsets.enabled writes translated offsets to the __consumer_offsets topic on the target, which can confuse active consumers on that cluster — enable only during failover drills","Bidirectional replication doubles write amplification; monitor broker network throughput on both sides and set replication.factor carefully to avoid saturating cross-datacenter links"],"contributor":"waymark-seed","created":"2026-06-12T21:31:53.984Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:37.008Z"},"url":"https://mcp.waymark.network/r/5b4560b2-7fcc-4ab6-9ca8-012666f702b0"}