尝试在Apache Kafka上创建主题时出错 [英] Error when trying to create a topic on Apache Kafka
问题描述
我正在尝试使用
$KAFKA_HOME/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic testing
,但是报告了以下错误:
but the following error is reported:
Error while executing topic command : Not all brokers have rack information. Add --disable-rack-aware in command line to make replica assignment without rack information.
[2018-01-23 15:03:44,471] ERROR kafka.admin.AdminOperationException: Not all brokers have rack information. Add --disable-rack-aware in command line to make replica assignment without rack information.
at kafka.admin.AdminUtils$.getBrokerMetadatas(AdminUtils.scala:443)
at kafka.admin.AdminUtils$.createTopic(AdminUtils.scala:461)
at kafka.admin.TopicCommand$.createTopic(TopicCommand.scala:110)
at kafka.admin.TopicCommand$.main(TopicCommand.scala:63)
at kafka.admin.TopicCommand.main(TopicCommand.scala)
(kafka.admin.TopicCommand$)
两个 zookeeper
$KAFKA_HOME/bin/zookeeper-server-start.sh $KAFKA_HOME/config/zookeeper.properties
和 kafka服务器
$KAFKA_HOME/bin/kafka-server-start.sh $KAFKA_HOME/config/server.properties
已成功启动.
添加-disable-rack-aware
可以解决此问题,但是如何使用机架信息进行副本分配?
Addition of --disable-rack-aware
will solve this issue but how can I make replica assignment with rack information?
推荐答案
我想并不是您的所有经纪人都具有机架配置.Grep您的server.properties以获取键 broker.rack
.如果这仅出现在部分而非全部服务器配置中,则可能是造成问题的原因.
I guess not all of your brokers have a rack configuration. Grep your server.properties for the key broker.rack
. If this appears only in some but not all of your server configurations this is the cause of your problem.
在这里您可以找到有关kafka机架识别的更多详细信息: https://community.hortonworks.com/questions/71458/can-anyone-explain-kafka-rack-awareness-feature.html
Here you can find some more details about kafka's rack awareness: https://community.hortonworks.com/questions/71458/can-anyone-explain-kafka-rack-awareness-feature.html
这篇关于尝试在Apache Kafka上创建主题时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!