Geo-replication strategies in Kafka - Commands & Configuration
bootstrap.servers=clusterA.kafka.local:9092 replication.policy.class=org.apache.kafka.connect.mirror.MirrorReplicationPolicy replication.factor=3 topics=important-topic,logs source.cluster.alias=clusterA target.cluster.alias=clusterB emit.heartbeats.enabled=true heartbeat.interval.seconds=30 sync.topic.acls.enabled=true
This configuration file sets up MirrorMaker 2 for geo-replication between two Kafka clusters.
bootstrap.servers: Connects to the source Kafka cluster.
replication.policy.class: Defines the replication strategy used.
replication.factor: Number of replicas for mirrored topics in the target cluster.
topics: Lists topics to replicate.
source.cluster.alias and target.cluster.alias: Names for source and target clusters.
emit.heartbeats.enabled and heartbeat.interval.seconds: Enable and set frequency for heartbeat messages to monitor replication health.
sync.topic.acls.enabled: Ensures access control lists are synced between clusters.
connect-mirror-maker replicator.properties
kafka-topics --bootstrap-server clusterB.kafka.local:9092 --list
--bootstrap-server - Specifies the Kafka cluster to connect to.--list - Lists all topics in the cluster.kafka-consumer-groups --bootstrap-server clusterB.kafka.local:9092 --describe --group mirror_maker_2
--describe - Shows detailed information about the consumer group.--group - Specifies the consumer group to describe.If you remember nothing else from geo-replication, remember: MirrorMaker 2 copies topics between Kafka clusters to keep data consistent and available across locations.