0
0
Kafkadevops~10 mins

Why multi-datacenter ensures availability in Kafka - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the replication factor for a Kafka topic.

Kafka
bin/kafka-topics.sh --create --topic my-topic --partitions 3 --replication-factor [1] --bootstrap-server localhost:9092
Drag options to blanks, or click blank then click option'
A3
B0
C1
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Setting replication factor to 1 means no replication, risking data loss.
2fill in blank
medium

Complete the code to configure Kafka producer to wait for acknowledgments from all replicas.

Kafka
props.put("acks", "[1]");
Drag options to blanks, or click blank then click option'
Aall
B1
C-1
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using '1' waits only for the leader, risking data loss if leader fails.
3fill in blank
hard

Fix the error in the consumer configuration to enable automatic failover across datacenters.

Kafka
props.put("group.id", "my-group");
props.put("enable.auto.commit", [1]);
Drag options to blanks, or click blank then click option'
A"true"
Bfalse
Ctrue
D"false"
Attempts:
3 left
💡 Hint
Common Mistakes
Using string values instead of boolean causes config errors.
4fill in blank
hard

Fill both blanks to create a Kafka topic with a replication factor and enable unclean leader election.

Kafka
bin/kafka-topics.sh --create --topic logs --partitions 5 --replication-factor [1] --config [2]=true --bootstrap-server localhost:9092
Drag options to blanks, or click blank then click option'
A3
B1
Cunclean.leader.election.enable
Dmin.insync.replicas
Attempts:
3 left
💡 Hint
Common Mistakes
Using replication factor 1 disables replication.
5fill in blank
hard

Fill all three blanks to configure a Kafka consumer to read from multiple datacenters with failover.

Kafka
props.put("bootstrap.servers", "[1]");
props.put("group.id", "[2]");
props.put("auto.offset.reset", "[3]");
Drag options to blanks, or click blank then click option'
Adc1.kafka.local:9092,dc2.kafka.local:9092
Bmulti-dc-group
Cearliest
Dlatest
Attempts:
3 left
💡 Hint
Common Mistakes
Using only one datacenter in bootstrap servers limits availability.