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 为storm consumer检查卡夫卡主题的偏移量_Apache Kafka_Apache Zookeeper_Apache Storm_Offset_Trident - Fatal编程技术网

Apache kafka 为storm consumer检查卡夫卡主题的偏移量

Apache kafka 为storm consumer检查卡夫卡主题的偏移量,apache-kafka,apache-zookeeper,apache-storm,offset,trident,Apache Kafka,Apache Zookeeper,Apache Storm,Offset,Trident,我正在使用storm kafka client 1.2.1,并为KafkaTridentSpoutOpaque创建喷口配置,如下所示 kafkaSpoutConfig = KafkaSpoutConfig.builder(brokerURL, kafkaTopic) .setProp(ConsumerConfig.GROUP_ID_CONFIG,"storm-kafka-group") .setProcess

我正在使用storm kafka client 1.2.1,并为KafkaTridentSpoutOpaque创建喷口配置,如下所示

            kafkaSpoutConfig = KafkaSpoutConfig.builder(brokerURL, kafkaTopic)
                .setProp(ConsumerConfig.GROUP_ID_CONFIG,"storm-kafka-group")
                .setProcessingGuarantee(ProcessingGuarantee.AT_MOST_ONCE)
                .setProp(ConsumerConfig.CLIENT_ID_CONFIG,InetAddress.getLocalHost().getHostName())
我在卡夫卡和Zookeeper中都找不到我的组id和偏移量。通过Zookeeper,我尝试了zkCli.sh并尝试了
ls/consumers
,但没有,因为我认为卡夫卡本身现在正在维护偏移量,而不是Zookeeper

我也用下面的命令尝试过卡夫卡

bin/kafka-run-class.sh kafka.admin.ConsumerGroupCommand  --list  --bootstrap-server localhost:9092
Note: This will not show information about old Zookeeper-based consumers.
console-consumer-20130
console-consumer-82696
console-consumer-6106
console-consumer-67393
console-consumer-14333
console-consumer-21174
console-consumer-64550

有人能帮我找到偏移量吗?如果我重新启动拓扑,它会再次在卡夫卡中回放我的事件吗?

Trident不会在卡夫卡中存储偏移量,而是在Storm的Zookeeper中存储偏移量。如果使用Storm的Zookeeper配置的默认设置运行,则Storm的Zookeeper中的路径类似于
/coordinator//meta

该路径下的对象将包含第一个和最后一个偏移量,以及每个批的主题分区。因此,例如,
/coordinator//meta/15
将包含批号15中发出的第一个和最后一个偏移量


重新启动后喷口是否重放偏移量由您在
KafkaSpoutConfig
中设置的
FirstPollOffsetStrategy
控制。默认值为未提交的,重新启动时不会重新启动。查看位于的Javadoc。

我可以在这里找到偏移量——通过在storm
ls/transactional//coordinator/meta的ZkCli中运行命令,如何使用主题分区(=5)并行使用来自Kafka的Trident storm的消费消息?有没有增加吞吐量的建议?