Kafka 1.0.1版本Mirror Maker启动错误求助
Hey there! Since you haven't shared the exact error message you're seeing, let's walk through the most common pitfalls based on the config you provided to get your Mirror Maker up and running:
1. Fix Configuration Typos & Formatting
First, let's address easy-to-miss syntax errors in your config:
- You wrote
groupid=test-MirrorMaker-group— that's a typo! The correct parameter name isgroup.id(with a dot, not a single word). - In Kafka 1.0.1,
mirror.topics.whitelistis typically passed as a startup argument (--whitelist) instead of being part of the consumer config. - Split your source and target configs into two separate files (e.g.,
consumer.propertiesandproducer.properties) for clarity and compatibility. Here's the corrected structure:
consumer.properties (source cluster config):
bootstrap.servers=XX.XXX.XX.XXX:9092,XX.XXX.XX.XXX:9092,XX.XXX.XX.XXX:9092 group.id=test-MirrorMaker-group exclude.internal.topics=true client.id=mirror_maker_consumer
producer.properties (target cluster config):
bootstrap.servers=XX.XXX.XX.XXX:9092,XX.XXX.XX.XXX:9092,XX.XXX.XX.XXX:9092 acks=1 batch.size=100 client.id=mirror_maker_producer
2. Verify Your Startup Command
For Kafka 1.0.1, the correct Mirror Maker launch command references the two separate config files and includes the whitelist explicitly:
bin/kafka-mirror-maker.sh --consumer.config consumer.properties --producer.config producer.properties --whitelist "test"
Double-check that you're not mixing up consumer/producer config paths, and that the whitelist pattern matches your target topic exactly.
3. Check Network & Broker Accessibility
- Test if your Mirror Maker host can reach both source and target brokers on port 9092. Use commands like
telnet XX.XXX.XX.XXX 9092ornc -zv XX.XXX.XX.XXX 9092to confirm connectivity. - Ensure Kafka brokers are configured to listen on external IPs (not just
localhost). Check the broker'slistenersconfig to make sure it's set to something likePLAINTEXT://0.0.0.0:9092or the specific external IP of the broker.
4. Validate Permissions
- Make sure the user running Mirror Maker has read access to the config files and execute access to the Kafka
bindirectory. - If either cluster uses ACLs, confirm:
- The consumer (with
group.id=test-MirrorMaker-group) has permission to read thetesttopic on the source cluster. - The producer has permission to write to the
testtopic on the target cluster.
- The consumer (with
5. Dig Into Logs for Exact Errors
If none of the above fixes the issue, check the Mirror Maker logs for specific details:
- By default, logs print directly to the console when you run the command.
- You can also find persistent logs in Kafka's
logsdirectory, usually underconnect-mirror-maker.log.
Look for keywords like "connection timeout", "invalid config", or "authorization denied" — these will point you straight to the root cause. If you can share the error snippet, we can narrow it down even further!
内容的提问来源于stack exchange,提问作者Sri

