gpt4 book ai didi

apache-kafka - 错误发送消息到主题时出错

转载 作者:行者123 更新时间:2023-12-03 10:20:38 25 4
gpt4 key购买 nike

在Kafka中生成消息时,出现以下错误:

$ bin/kafka-console-producer.sh --broker-list localhost:9092 --topic nil_PF1_P1
hi
hello

[2016-07-19 17:06:34,542] ERROR Error when sending message to topic nil_PF1_P1 with key: null, value: 2 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
[2016-07-19 17:07:34,544] ERROR Error when sending message to topic nil_PF1_P1 with key: null, value: 5 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.


$ bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic nil_PF1_P1
Topic:nil_PF1_P1 PartitionCount:1 ReplicationFactor:1 Configs:
Topic: nil_PF1_P1 Partition: 0 Leader: 2 Replicas: 2 Isr: 2

任何想法吗?

最佳答案

无需更改server.properties,而是在代码本身中包含地址0.0.0.0
代替

/usr/bin/kafka-console-producer --broker-list Hostname:9092 --topic MyFirstTopic1

采用
/usr/bin/kafka-console-producer --broker-list 0.0.0.0:9092 --topic MyFirstTopic1

关于apache-kafka - 错误发送消息到主题时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38457706/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com