WARN [Producer clientId=console-producer] Connection to node -1 could not be established. Broker may

kafka连接生产者(消费者其实也一样的问题)出现了下面这个报错:(

WARN [Producer clientId=console-producer] Connection to node -1 could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)

找到配置文件

WARN [Producer clientId=console-producer] Connection to node -1 could not be established. Broker may_第1张图片

在配置plaintext的时候,地址配置的是master(master是我在/etc/hosts文件里面配置的127.0.0.1),而我连接的时候,使用的是:

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

改为:

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

perfect,完美的解决了(生产者也一样哦)

真的很奇怪,为什么不能自动转换过来



你可能感兴趣的:(kafka)