1. 程式人生 > 其它 >【Kafka問題解決】Connection to xxx could not be established. Broker may not be available.

【Kafka問題解決】Connection to xxx could not be established. Broker may not be available.

技術標籤:問題解決kafkaleetcodesocketbug分散式

請檢查Kafka的config/server.properties
看看是否有填寫

listeners=PLAINTEXT://kafka-host:9092
advertised.listeners=PLAINTEXT://kafka-host:9092

這裡的kafka-host需要在/etc/hosts進行對映,服務端對映到本地或內網ip,客戶端對映到服務端ip

問題解決。