1. 连接kafka时报错:Connection to xxx could not be established. Broker may not be available.
在配置文件config/server.properties中,确认listeners和advertised.listeners的配置。
listeners=PLAINTEXT://kafka-host:9092
advertised.listeners=PLAINTEXT://kafka-host:9092
在访问kafka的机器上,应在hosts文件中添加对应主机名的映射。
windows系统的主机映射文件为:C:\Windows\System32\drivers\etc\hosts
Linux系统的主机映射文件为:/etc/hosts
192.168.0.181 kafka-host