報錯背景:
新安裝的單機版kafka啓動消費者的時候報錯!apache
報錯現象:
[2020-05-19 22:08:04,053] WARN [Consumer clientId=consumer-console-consumer-36457-1, groupId=console-consumer-36457] Bootstrap broker basecoalmine:2181 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient) [2020-05-19 22:08:04,990] WARN [Consumer clientId=consumer-console-consumer-36457-1, groupId=console-consumer-36457] Bootstrap broker basecoalmine:2181 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient) [2020-05-19 22:08:06,086] WARN [Consumer clientId=consumer-console-consumer-36457-1, groupId=console-consumer-36457] Bootstrap broker basecoalmine:2181 (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
報錯緣由:
端口號的問題,之前啓動消費者的時候監聽的端口是 2181,可是新版本的kafka對zookeeper的依賴沒有那麼強烈了,因此改爲了本身的 9092。bootstrap
kafka-console-consumer.sh --bootstrap-server basecoalmine:2181 --topic test --from-beginning
報錯解決:
修改端口號spa
kafka-console-consumer.sh --bootstrap-server basecoalmine:9092 --topic test --from-beginning