Producer clientId=console-producer Bootstrap broker localhost:9092 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient);
针对这种报错,说明你的生产者或者消费者连接kafka失败
说明:我的kafka版本是kafka_2.12-2.7.1
我的单机版kafka server.properties配置是这样的
消费方consumer.properties
在linux器启动生产者时,用这个命令
[root@localhost kafka_2.12-2.7.1]# bin/kafka-console-producer.sh --bootstrap-server PLAINTEXT://192.168.135.130:9092 --topic animal
启动消费者时,用这个命令
[root@localhost kafka_2.12-2.7.1]# bin/kafka-console-producer.sh --bootstrap-server PLAINTEXT://192.168.135.130:9092 --topic animal