Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache kafka 无法建立到节点-1(x.x.x.x/:9092)的连接。经纪人可能不在_Apache Kafka_Apache Zookeeper - Fatal编程技术网

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

Apache kafka 无法建立到节点-1(x.x.x.x/:9092)的连接。经纪人可能不在,apache-kafka,apache-zookeeper,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 zookeepe

我的问题是我在不同的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,并创建了myid文件insite/tmp/zookeeper dir

现在,当我通过仅通过一个ip地址生成消息来测试kafka群集时,如下图所示。/bin/kafka-console-producer.sh--代理列表172.171.0.3:9092--主题演示正常工作。但是,当我关闭一个容器(它是leader)时,我仍然从主题中获得消息。但当我再次运行消费者脚本时,它会向我显示警告msgs:-

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


现在我无法获取消息,我该怎么办?

您也可以包含console consumer命令吗?为什么手动使用容器的属性文件?合流、Bitnami、wurstmeister Kafka图像都是通过环境变量完全配置的。。。但无论如何,请显示Kafka确实在启动,而不是显示客户端的错误Hey mickael的可能副本,这是console consumer命令/bin/kafka-console-consumer.sh-引导服务器172.171.0.3:9092-主题演示-从头开始-分区0消费者主题的复制系数是多少?server.properties文件中property offset.topic.replication.factor=1的值