0
0
Kafkadevops~20 mins

MirrorMaker 2 concept in Kafka - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
MirrorMaker 2 Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the primary role of MirrorMaker 2 in Kafka?
MirrorMaker 2 is a tool used in Kafka ecosystems. What is its main purpose?
ATo manage Kafka topic configurations automatically
BTo compress Kafka messages to save storage space
CTo monitor Kafka cluster health and performance metrics
DTo replicate data between Kafka clusters for disaster recovery and geo-replication
Attempts:
2 left
💡 Hint
Think about data movement between clusters.
Predict Output
intermediate
2:00remaining
What output does this MirrorMaker 2 configuration produce?
Given this MirrorMaker 2 configuration snippet, what will be the effect?
Kafka
clusters = {
  'primary': {
    'bootstrap.servers': 'primary.kafka:9092'
  },
  'secondary': {
    'bootstrap.servers': 'secondary.kafka:9092'
  }
}

tasks.max = 2

replication.policy.class = org.apache.kafka.connect.mirror.DefaultReplicationPolicy

# Replicate all topics from primary to secondary
source.cluster = primary
target.cluster = secondary
ANo topics will be replicated because tasks.max is too low
BOnly topics starting with 'primary' will be replicated
CAll topics from the primary cluster will be replicated to the secondary cluster
DTopics will be replicated from secondary to primary cluster
Attempts:
2 left
💡 Hint
Look at source and target cluster settings.
🔧 Debug
advanced
2:30remaining
Why does this MirrorMaker 2 setup fail to replicate topics?
This MirrorMaker 2 config does not replicate any topics. Identify the cause.
Kafka
clusters = {
  'clusterA': {
    'bootstrap.servers': 'clusterA.kafka:9092'
  },
  'clusterB': {
    'bootstrap.servers': 'clusterB.kafka:9092'
  }
}

tasks.max = 1

replication.policy.class = org.apache.kafka.connect.mirror.DefaultReplicationPolicy

source.cluster = clusterA
target.cluster = clusterB

# Missing topics whitelist filter
ABecause no topics are specified in the whitelist, no topics are replicated
BBecause tasks.max is set to 1, replication is disabled
CBecause replication.policy.class is incorrect, replication fails
DBecause source and target clusters are reversed, replication fails
Attempts:
2 left
💡 Hint
Check if topics are selected for replication.
📝 Syntax
advanced
2:00remaining
Which MirrorMaker 2 configuration snippet is syntactically correct?
Select the configuration snippet that is valid for MirrorMaker 2.
A
clusters = { 'src' => { 'bootstrap.servers' => 'src.kafka:9092' }, 'dest' => { 'bootstrap.servers' => 'dest.kafka:9092' } }
tasks.max=3
source.cluster=src
target.cluster=dest
B
clusters = { 'src': { 'bootstrap.servers': 'src.kafka:9092' }, 'dest': { 'bootstrap.servers': 'dest.kafka:9092' } }
tasks.max=3
source.cluster=src
target.cluster=dest
C
clusters = [ 'src': { 'bootstrap.servers': 'src.kafka:9092' }, 'dest': { 'bootstrap.servers': 'dest.kafka:9092' } ]
tasks.max=3
source.cluster=src
target.cluster=dest
D
clusters = { 'src': { 'bootstrap.servers': 'src.kafka:9092' }, 'dest': { 'bootstrap.servers': 'dest.kafka:9092' } }
tasks.max=three
source.cluster=src
target.cluster=dest
Attempts:
2 left
💡 Hint
Look for correct data structure and value types.
🚀 Application
expert
3:00remaining
How does MirrorMaker 2 handle topic offsets during replication?
When MirrorMaker 2 replicates topics between clusters, how does it manage consumer offsets to ensure consumers can continue seamlessly?
AIt replicates consumer offsets to the target cluster's __consumer_offsets topic to maintain consumer group state
BIt resets all consumer offsets to zero on the target cluster after replication
CIt does not replicate offsets; consumers must manually reset offsets on the target cluster
DIt stores offsets externally in a separate database outside Kafka
Attempts:
2 left
💡 Hint
Think about how consumer groups keep track of their position.