无法建立与节点-1(x.x.x.x /:9092)的连接。经纪人可能不可用

时间:2018-12-14 10:42:38

标签: apache-kafka apache-zookeeper

我的问题是我在不同的Docker容器(Ubuntu)上设置了2个kafka代理和2个zookeeper节点。

这是我的server1.properties配置文件

broker.id=1

############################# Socket Server Settings 

listeners=PLAINTEXT://0.0.0.0:9092

advertised.listeners=PLAINTEXT://ipaddress_server1:9092

zookeeper.properties配置文件-

dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
# disable the per-ip limit on the number of connections since this is a non-production config
maxClientCnxns=200
tickTime=2000
initLimit=20
syncLimit=10

这是kafka和zookeeper服务器的属性。我为每个服务器指定了唯一的代理ID,并在站点/ tmp / zookeeper目录中创建了myid文件。

现在,当我通过仅通过一个IP地址生成消息(例如./bin/kafka-console-producer.sh --broker-list 172.171.0.3:9092 --topic演示)来测试kafka群集时,它可以正常工作。但是当我关闭一个领导者的容器时,仍然从该主题中获取消息。但是,当我再次运行使用者脚本时,它向我显示警告消息:-

  

无法建立到节点-1的连接(/172.171.0.3:9092)。   经纪人可能不可用

现在我无法收到消息,我该怎么办?

0 个答案:

没有答案
相关问题