0
0
Kafkadevops~10 mins

Broker configuration basics 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 broker ID in the Kafka server properties.

Kafka
broker.id=[1]
Drag options to blanks, or click blank then click option'
A"broker1"
B1
Ctrue
Dlocalhost
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string instead of an integer for broker.id
Setting broker.id to true or localhost
2fill in blank
medium

Complete the code to specify the port number the Kafka broker listens on.

Kafka
listeners=PLAINTEXT://:[1]
Drag options to blanks, or click blank then click option'
A9092
B2181
C9090
D8080
Attempts:
3 left
💡 Hint
Common Mistakes
Using port 8080 which is common for web servers
Using port 2181 which is for Zookeeper
3fill in blank
hard

Fix the error in the configuration line to correctly set the log directory.

Kafka
log.dirs=[1]
Drag options to blanks, or click blank then click option'
A/var/lib/kafka logs
Bvar/lib/kafka-logs
C/var/lib/kafka-logs
D/var/lib/kafka_logs
Attempts:
3 left
💡 Hint
Common Mistakes
Missing leading slash making path relative
Including spaces in directory names
4fill in blank
hard

Fill both blanks to configure the number of partitions and replication factor for a topic.

Kafka
num.partitions=[1]
default.replication.factor=[2]
Drag options to blanks, or click blank then click option'
A3
B1
C2
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Setting replication factor higher than number of brokers
Using 1 partition which limits parallelism
5fill in blank
hard

Fill all three blanks to configure the broker's advertised listeners and log retention time.

Kafka
advertised.listeners=[1]
listener.security.protocol.map=[2]
log.retention.hours=[3]
Drag options to blanks, or click blank then click option'
APLAINTEXT://broker1:9092
BPLAINTEXT:PLAINTEXT
C168
DSSL
Attempts:
3 left
💡 Hint
Common Mistakes
Using only hostname without protocol in advertised.listeners
Setting retention time too low or too high without reason