Complete the code to set the replication factor for a Kafka topic.
kafka-topics --create --topic my-topic --partitions 3 --replication-factor [1] --bootstrap-server localhost:9092
The replication factor defines how many copies of the data are kept across Kafka brokers. Setting it to 3 means the data is replicated on 3 brokers for fault tolerance.
Complete the code to configure MirrorMaker 2 to replicate topics from source to target cluster.
bin/kafka-mirror-maker.sh --consumer.config consumer.properties --producer.config producer.properties --whitelist [1]The whitelist '.*' means all topics will be replicated from the source cluster to the target cluster.
Fix the error in the MirrorMaker 2 configuration to enable active-active geo-replication.
clusters = [1] replication.policy.class = org.apache.kafka.connect.mirror.DefaultReplicationPolicy
The clusters property must list all clusters separated by commas without spaces or other delimiters.
Fill both blanks to create a topic configuration that enables geo-replication with idempotent producer and exactly-once semantics.
enable.idempotence=[1] processing.guarantee=[2]
Setting enable.idempotence to true ensures no duplicate messages. Setting processing.guarantee to exactly_once enables exactly-once semantics for geo-replication.
Fill all three blanks to configure MirrorMaker 2 with source cluster alias, target cluster alias, and replication factor.
clusters = [1] source.cluster.alias = [2] target.cluster.alias = [3]
The clusters property lists both clusters separated by a comma. The source and target cluster aliases are set to 'us-east' and 'us-west' respectively to identify clusters in geo-replication.