Challenge - 5 Problems
Cross-Datacenter Replication 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 Kafka MirrorMaker2 configuration snippet?
Given the following MirrorMaker2 configuration snippet, what will be the value of
source.cluster.bootstrap.servers after parsing?Kafka
clusters = {
"source": {
"bootstrap.servers": "source1:9092,source2:9092"
},
"target": {
"bootstrap.servers": "target1:9092"
}
}
source_bootstrap = clusters["source"]["bootstrap.servers"]
print(source_bootstrap)Attempts:
2 left
💡 Hint
Look at how the dictionary keys are accessed for the source cluster.
✗ Incorrect
The configuration dictionary has a key 'source' which contains 'bootstrap.servers' with the value 'source1:9092,source2:9092'. Accessing clusters['source']['bootstrap.servers'] returns this string.
🧠 Conceptual
intermediate1:30remaining
Which option best describes the role of MirrorMaker2 in cross-datacenter replication?
Select the correct description of MirrorMaker2's function in Kafka cross-datacenter replication.
Attempts:
2 left
💡 Hint
Think about what cross-datacenter replication means for Kafka data.
✗ Incorrect
MirrorMaker2 is designed to replicate topics between Kafka clusters in different data centers to improve availability and disaster recovery.
🔧 Debug
advanced2:30remaining
What error does this MirrorMaker2 connector configuration cause?
Consider this MirrorMaker2 connector config snippet:
```
"source.cluster": "clusterA",
"target.cluster": "clusterB",
"topics": "^important-.*",
"tasks.max": "two"
```
What error will occur when starting the connector?
Attempts:
2 left
💡 Hint
Check the expected data type for 'tasks.max' in Kafka connector configs.
✗ Incorrect
'tasks.max' expects an integer value. Providing the string 'two' causes a ValueError when the system tries to convert it to int.
📝 Syntax
advanced1:30remaining
Which option correctly defines a Kafka Connect replication policy class in MirrorMaker2?
Choose the correct Java class name syntax for a custom replication policy in MirrorMaker2 configuration.
Attempts:
2 left
💡 Hint
Java class names follow a specific naming convention and do not include parentheses.
✗ Incorrect
Java class names use PascalCase without underscores and do not include parentheses when referenced in configs.
🚀 Application
expert3:00remaining
How many topics will be replicated with this MirrorMaker2 topic regex?
If the source Kafka cluster has topics: ["orders", "orders-2023", "payments", "payments-2023", "logs", "logs-archive"], and MirrorMaker2 is configured with:
```
topics = "^(orders|payments)-2023$"
```
How many topics will MirrorMaker2 replicate?
Attempts:
2 left
💡 Hint
Check which topic names exactly match the regex pattern.
✗ Incorrect
The regex matches topics that start with 'orders' or 'payments' and end exactly with '-2023'. Only 'orders-2023' and 'payments-2023' match.