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 卡夫卡制镜机不工作_Apache Kafka_Kafka Consumer Api_Kafka Producer Api - Fatal编程技术网

Apache kafka 卡夫卡制镜机不工作

Apache kafka 卡夫卡制镜机不工作,apache-kafka,kafka-consumer-api,kafka-producer-api,Apache Kafka,Kafka Consumer Api,Kafka Producer Api,我面临一个奇怪的问题,我的mirror maker能够在目标集群中镜像主题名称,但当我尝试使用来自它的消息时,却看不到任何消息。下面是我的配置文件- producer.config bootstrap.servers=dest_broker_ip:9092,dest_broker_ip:9092 acks=1 batch.size=100 max.in.flight.requests.per.connection=1 retries=1000000 client.id=mirror_maker_

我面临一个奇怪的问题,我的mirror maker能够在目标集群中镜像主题名称,但当我尝试使用来自它的消息时,却看不到任何消息。下面是我的配置文件-

producer.config

bootstrap.servers=dest_broker_ip:9092,dest_broker_ip:9092
acks=1
batch.size=100
max.in.flight.requests.per.connection=1
retries=1000000
client.id=mirror_maker_producer
consumer.config

bootstrap.servers=source_broker_ip:9092,source_broker_ip:9092,source_broker_ip:9092    
exclude.internal.topics=true
group.id=test-consumer-group_3
client.id=mirror_maker_consumer
然后使用以下命令启动镜像生成器

bin/kafka-run-class.sh kafka.tools.MirrorMaker --consumer.config config/consumer.config --producer.config config/producer.config --whitelist=".*"
启动镜像生成器后,我将转到源集群,并使用下面的命令创建一个主题和一些消息

bin/kafka-verifiable-producer.sh --topic u39 --max-messages 2000 --broker-list 10.******:9092
bin/kafka-console-consumer.sh --zookeeper 10.200.14.117:2181 --topic u39 --from-beginning
这将创建一个主题u39,并向其推送2000条消息。现在,如果我在同一个源集群上运行consumer,我就能够使用确认消息是在源集群上生成的消息

现在,我转到我的目标群集,尝试创建一个同名的主题,即u39。这将返回一个错误,说明主题已存在,确认mirror maker已将主题从源群集复制到目标群集,但当我尝试使用目标群集上的消息时,使用下面的命令

bin/kafka-verifiable-producer.sh --topic u39 --max-messages 2000 --broker-list 10.******:9092
bin/kafka-console-consumer.sh --zookeeper 10.200.14.117:2181 --topic u39 --from-beginning
我没有看到任何消息。不确定哪里出了问题,非常感谢您的帮助/指导

更新1-我正在使用卡夫卡1.0.0


更新2-两个集群完全隔离。设置在AWS上,一个集群位于east-1,另一个位于west-2。同样,我能够在两个集群上分别生成和使用消息。

我认为您混合了来自不同版本控制台使用者的语法。默认值现在应该是新使用者,新使用者将需要引导服务器而不是ZooKeeper

尝试:


kafka-console-consumer.sh--引导服务器10.*****:9092--主题u39--从一开始

较新的kafka消费者使用
引导服务器而不是Zookeeperyes我使用的是引导服务器?我在问题中看到了
kafka-console-consumer.sh--zookeeper
,而不是
kafka-console-consumer.sh--bootstrap服务器
不工作,它发出错误警告[consumer clientId=consumer-1,groupId=console-consumer-73211]无法建立到节点-1的连接。经纪人可能不在。(org.apache.kafka.clients.NetworkClient)