1. 首页
  2. 软件开发
  3. 测试中遇到 kafka 报错:Connection to node -1 could not be established. Broker may not be available.

测试中遇到 kafka 报错:Connection to node -1 could not be established. Broker may not be available.

  • 发布于 2024-09-25
  • 1 次阅读

原文链接:https://blog.csdn.net/q1177660557/article/details/79000524

kafka报错内容:

原因:因为你的配置文件中的PLAINTEXT跟你请求的内容不同。

举例来说,我在配置文件里配置的listeners=PLAINTEXT://10.127.96.151:9092,但是我想测试的时候请求的是./kafka-console-consumer.sh –bootstrap-server localhost:9092 –topic topic1 –from-beginning

正确的应该是./kafka-console-consumer.sh –bootstrap-server 10.127.96.151:9092 –topic topic1 –from-beginning

原文链接: https://onlyou.blog.csdn.net//article/details/102738201