用kafka命令发送消息时候,一直报WARN Error while fetching metadata with correlation id 0 : {test=UNKNOWN_TOPIC_OR_PARTITION}?

小蕊 发表于: 2016-10-08   最后更新时间: 2016-10-08  
  •   7 订阅,1401 游览

使用发送命令

bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test

然后随便打入一条消息,就一直刷警告 WARN Error while fetching metadata with correlation id 0 : {test=UNKNOWN_TOPIC_OR_PARTITION},请问有人遇到过吗?

bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
nihao
[2016-10-08 17:58:54,821] WARN Error while fetching metadata with correlation id 0 : {test=UNKNOWN_TOPIC_OR_PARTITION} (org.apache.kafka.clients.NetworkClient)
[2016-10-08 17:58:55,026] WARN Error while fetching metadata with correlation id 1 : {test=UNKNOWN_TOPIC_OR_PARTITION} (org.apache.kafka.clients.NetworkClient)
[2016-10-08 17:58:55,128] WARN Error while fetching metadata with correlation id 2 : {test=UNKNOWN_TOPIC_OR_PARTITION} (org.apache.kafka.clients.NetworkClient)
[2016-10-08 17:58:55,230] WARN Error while fetching metadata with correlation id 3 : {test=UNKNOWN_TOPIC_OR_PARTITION} (org.apache.kafka.clients.NetworkClient)
[2016-10-08 17:58:55,332] WARN Error while fetching metadata with correlation id 4 : {test=UNKNOWN_TOPIC_OR_PARTITION} (org.apache.kafka.clients.NetworkClient)






发表于: 6月前   最后更新时间: 6月前   游览量:1401
上一条: kafka启动报 java.lang.ExceptionInInitializerError at kafka.network.RequestChannel$Request. 有遇到的吗?
下一条: mac系统升级后,git报xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Librar
评论…

  • 你看下kafka集群的配置文件,是否设置了auto.create.topics.enable=false。如果有,就设置为ture。
    可能是你的topic不存在,导致的。让它自动创建。
    或者你也可以手动创建
    bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 2 --partitions 4 --topic test
  • 评论…
    • in this conversation
      提问