kafka報錯內容:
WARN [Consumer clientId=consumer-1, groupId=console-consumer-950] Connection to node -1 could not be established. Broker may not be available.
這是因爲你的配置文件中的PLAINTEXT跟你請求的內容不同。舉例來說,我在配置文件裏配置的listeners=PLAINTEXT://10.10.10.10:9092,但是我想測試的時候請求的是./kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic topic_name --from-beginning
正確的應該是./kafka-console-consumer.sh --bootstrap-server 10.10.10.10:9092 --topic topic_name --from-beginning