CDH5.15.0 kafka调试报错Connection to node -1 could not be established. Broker may not be available.

在CDH5.15.0版本集群中加入kafka服务后,使用kafka自带的命令行生产者kafka-console-producer和命令行消费者kafka-console-consumer进行调试时,producer端启动,输入消息回车后报错WARN clients.NetworkClient: [Producer clientId=console-producer] Connection to node -1 could not be established. Broker may not be available.
CDH5.15.0 kafka调试报错Connection to node -1 could not be established. Broker may not be available._第1张图片
可能是因为启动生产者时的端口设置错误,比如我的启动命令在test-szzt02上,但是却发送到test-szzt01:9092,应该是test-szzt02:9092。(这里我理解错误,kafka的producer跟zookeeper是无关的,我以为提交给zookeeper集群就可以了)
在这里插入图片描述

你可能感兴趣的:(CDH,kafka)