Challenge - 5 Problems
Kafka Broker Configuration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this broker configuration snippet?
Given the following Kafka broker configuration snippet, what will be the value of
log.retention.hours after applying it?Kafka
log.retention.hours=168 log.retention.minutes=10080
Attempts:
2 left
💡 Hint
Kafka uses the most specific time unit setting for retention. If both hours and minutes are set, the hours setting takes precedence.
✗ Incorrect
Kafka broker configuration prioritizes the most specific time unit. Here,
log.retention.hours is set to 168 hours (7 days). The log.retention.minutes setting is ignored because log.retention.hours is present.❓ Predict Output
intermediate2:00remaining
What happens if
num.network.threads is set to 0?Consider this Kafka broker configuration line:
num.network.threads=0What will happen when the broker starts?
Kafka
num.network.threads=0Attempts:
2 left
💡 Hint
Some thread count settings must be positive integers.
✗ Incorrect
Kafka requires
num.network.threads to be a positive integer. Setting it to 0 causes a configuration validation failure and the broker will not start.🔧 Debug
advanced3:00remaining
Why does the broker ignore the
log.segment.bytes setting?A user sets the following in
server.properties:
log.segment.bytes=1073741824 log.segment.ms=604800000But the broker still creates log segments smaller than 1GB. What is the most likely reason?
Kafka
log.segment.bytes=1073741824 log.segment.ms=604800000
Attempts:
2 left
💡 Hint
Kafka rolls log segments based on whichever limit is reached first: size or time.
✗ Incorrect
Kafka rolls over log segments when either the size limit (
log.segment.bytes) or the time limit (log.segment.ms) is reached. Here, the time limit causes segments to roll over before reaching 1GB size.📝 Syntax
advanced1:30remaining
Which configuration line is syntactically correct for setting broker ID?
Choose the correct syntax to set the broker ID to 5 in
server.properties:Attempts:
2 left
💡 Hint
Kafka configuration uses key=value pairs without spaces around the equals sign.
✗ Incorrect
Kafka broker configuration requires no spaces around the equals sign. The correct syntax is
broker.id=5.🚀 Application
expert2:30remaining
How many log directories will Kafka use with this configuration?
Given this Kafka broker configuration:
log.dirs=/kafka-logs-1,/kafka-logs-2,/kafka-logs-3How many separate log directories will the broker use to store data?
Kafka
log.dirs=/kafka-logs-1,/kafka-logs-2,/kafka-logs-3
Attempts:
2 left
💡 Hint
Kafka splits partitions across all directories listed in
log.dirs.✗ Incorrect
Kafka uses all directories listed in
log.dirs to store partitions. Here, three directories are specified, so the broker will use three separate log directories.