0
0
Kafkadevops~10 mins

ZooKeeper role (and KRaft replacement) 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 start a Kafka broker with ZooKeeper connection.

Kafka
bin/kafka-server-start.sh config/server.properties --override zookeeper.connect=[1]
Drag options to blanks, or click blank then click option'
Alocalhost:9092
Blocalhost:2181
Clocalhost:9093
Dlocalhost:9094
Attempts:
3 left
💡 Hint
Common Mistakes
Using Kafka broker port instead of ZooKeeper port.
2fill in blank
medium

Complete the configuration to enable KRaft mode in Kafka broker.

Kafka
process.roles=[1]
Drag options to blanks, or click blank then click option'
Acontroller
Bbroker
Cbroker,controller
Dzookeeper
Attempts:
3 left
💡 Hint
Common Mistakes
Setting only 'broker' or 'controller' role alone.
3fill in blank
hard

Fix the error in the KRaft controller quorum configuration.

Kafka
controller.quorum.voters=[1]
Drag options to blanks, or click blank then click option'
A1@localhost:9093,2@localhost:9094,3@localhost:9095
Blocalhost:9093,localhost:9094,localhost:9095
Clocalhost:9093;localhost:9094;localhost:9095
D1:localhost:9093,2:localhost:9094,3:localhost:9095
Attempts:
3 left
💡 Hint
Common Mistakes
Using colons instead of '@', or missing voter ids.
4fill in blank
hard

Fill both blanks to configure the KRaft metadata log directory and cluster id.

Kafka
metadata.log.dir=[1]
cluster.id=[2]
Drag options to blanks, or click blank then click option'
A/var/lib/kafka/kraft-combined-logs
B/tmp/kafka-logs
C"A1B2C3D4-E5F6-7890-1234-56789ABCDEF0"
D"12345678-1234-1234-1234-123456789abc"
Attempts:
3 left
💡 Hint
Common Mistakes
Using default log directory or invalid cluster id format.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps broker ids to their ports in KRaft mode.

Kafka
broker_ports = [1]: [2] for [3] in range(1, 4)}
Drag options to blanks, or click blank then click option'
Aid
Bid * 1000 + 9092
Dport
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong variable names or incorrect port calculation.