1、idea使用springboot+kafka连接kafka服务,始终连接不上错误日志如下
Connection to node -1 could not be established. Broker may not be available.
**原因分析:**连接kafka时,有一个配置
bootstrap.servers = [localhost:9092]
由于本机没有配置localhost路由地址,所以系统连接不到服务
**解决方法:**在本机中路径下C:\Windows\System32\drivers\etc,下的hosts文件,配置
192.168.80.103 localhost