kafka集群 报错 could not be established. Broker may not be available host

最近在学习kafka 要搭建集群测试,在搭建的过程中遇到一些问题 记录下

linux版本:centos8

zookeeper版本:3.6.2

kafka版本:2.7.0

参考文章:https://blog.csdn.net/matrix_google/article/details/86684832

共3台机器,ip都做了映射

/etc/host配置:

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 x64-1

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.70.81 x64-1

192.168.70.82 x64-2

192.168.70.83 x64-3

 

kafka server.properties配置:

listeners=PLAINTEXT://x64-1:9092

 

以上配置3台机器kafka启动后

执行消费者命令: kafka-console-consumer.sh --bootstrap-server x64-1:9092,x64-2:9092,x64-3:9092 --topic test1

就报这个错 could not be established. Broker may not be available host

经查发现listeners实际绑定是127.0.0.1,而其他节点访问x64-1这个节点的都是192.168.70.81:9092 

所以这里ip就对不上了 需要把上面/etc/host中红色的127.0.0.1改成本机实际的ip 3台机器就能访问通了

 

 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值