现象
[root@kafka-3 bin]# ./kafka-console-producer.sh --broker-list localhost:9092 --topic test >sdssd [2018-03-20 17:58:01,409] WARN [Producer clientId=console-producer] Connection to node -1 could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient) [2018-03-20 17:58:01,461] WARN [Producer clientId=console-producer] Connection to node -1 could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient) [2018-03-20 17:58:01,571] WARN [Producer clientId=console-producer] Connection to node -1 could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
解决方法:
将localhost改成PLAINTEXT配置的地址即可,估计localhost没配置,kafka不认。
精彩评论