Challenge - 5 Problems
Kafka Geo-Replication Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of Kafka MirrorMaker 2 configuration
Given the following MirrorMaker 2 configuration snippet, what will be the output in the target cluster after replication?
Kafka
clusters = {
"source": {"bootstrap.servers": "source.kafka:9092"},
"target": {"bootstrap.servers": "target.kafka:9092"}
}
tasks.max = 2
replication.policy.class = "org.apache.kafka.connect.mirror.DefaultReplicationPolicy"
# Topics to replicate
replication.topics = "topicA,topicB"
# MirrorMaker 2 replicates topicA and topicB from source to target
# Assume topicA has 3 partitions with messages 1 to 3, topicB has 2 partitions with messages 10 to 11
# What messages will appear in target cluster topics after MirrorMaker 2 runs?Attempts:
2 left
💡 Hint
MirrorMaker 2 replicates specified topics with their partitions and messages from source to target.
✗ Incorrect
MirrorMaker 2 replicates the specified topics (topicA and topicB) from the source cluster to the target cluster, preserving partitions and messages.
🧠 Conceptual
intermediate1:30remaining
Understanding active-active geo-replication
Which statement best describes active-active geo-replication in Kafka?
Attempts:
2 left
💡 Hint
Active-active means all clusters can write data and replicate.
✗ Incorrect
Active-active geo-replication allows multiple Kafka clusters in different regions to accept writes and replicate data to each other, supporting multi-region active writes.
🔧 Debug
advanced2:00remaining
Identify the error in MirrorMaker 2 replication config
What error will occur when running MirrorMaker 2 with this configuration snippet?
replication.policy.class = "org.apache.kafka.connect.mirror.NonExistentPolicy"
clusters = {
"source": {"bootstrap.servers": "source.kafka:9092"},
"target": {"bootstrap.servers": "target.kafka:9092"}
}
replication.topics = "topicX"
Attempts:
2 left
💡 Hint
Check if the replication policy class exists in Kafka MirrorMaker 2.
✗ Incorrect
MirrorMaker 2 requires a valid replication policy class. Using a non-existent class causes a ClassNotFoundException at startup.
📝 Syntax
advanced1:30remaining
Correct syntax for MirrorMaker 2 topic whitelist
Which option correctly sets MirrorMaker 2 to replicate only topics starting with 'logs-'?
Attempts:
2 left
💡 Hint
MirrorMaker 2 uses regex property for pattern matching topics.
✗ Incorrect
To replicate topics by pattern, MirrorMaker 2 uses replication.topics.regex with a valid regex string.
🚀 Application
expert3:00remaining
Designing a geo-replication strategy for low latency writes
You have two Kafka clusters in different continents. You want to allow applications in both regions to write data with minimal latency and keep data synchronized. Which geo-replication strategy should you choose?
Attempts:
2 left
💡 Hint
Consider latency and write availability in multiple regions.
✗ Incorrect
Active-active replication allows both clusters to accept writes locally, reducing latency and replicating data bidirectionally to keep clusters synchronized.