0
0
Kafkadevops~10 mins

Replication factor in Kafka - Interactive Code Practice

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 to 3 when creating a Kafka topic.

Kafka
kafka-topics --create --topic my-topic --partitions 1 --replication-factor [1] --bootstrap-server localhost:9092
Drag options to blanks, or click blank then click option'
A1
B3
C0
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Setting replication factor to 0 causes an error.
Using replication factor 1 means no replication.
2fill in blank
medium

Complete the code to describe the replication factor of the topic named 'orders'.

Kafka
kafka-topics --describe --topic orders --bootstrap-server localhost:9092 | grep ReplicationFactor:[1]
Drag options to blanks, or click blank then click option'
A3
B1
C2
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 or 1 will not show the expected replication factor.
Confusing partition count with replication factor.
3fill in blank
hard

Fix the error in the command to create a topic with replication factor 2.

Kafka
kafka-topics --create --topic test-topic --partitions 3 --replication-factor [1] --bootstrap-server localhost:9092
Drag options to blanks, or click blank then click option'
A2
B4
C0
D-1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 or negative numbers causes errors.
Setting replication factor higher than broker count causes errors.
4fill in blank
hard

Fill both blanks to create a topic with 4 partitions and replication factor 3.

Kafka
kafka-topics --create --topic logs --partitions [1] --replication-factor [2] --bootstrap-server localhost:9092
Drag options to blanks, or click blank then click option'
A4
B3
C2
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up partitions and replication factor values.
Using replication factor higher than available brokers.
5fill in blank
hard

Fill all three blanks to create a topic with replication factor 2, 5 partitions, and bootstrap server at localhost:9093.

Kafka
kafka-topics --create --topic metrics --partitions [1] --replication-factor [2] --bootstrap-server [3]
Drag options to blanks, or click blank then click option'
A5
B2
Clocalhost:9093
Dlocalhost:9092
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong port for bootstrap server.
Confusing partitions with replication factor.