简体   繁体   English

Flume 1.7&Kafka-如何在主题开始时重新启动?

[英]Flume 1.7 & Kafka - How to restart at the beginning of the topic?

I'm using a Flume 1.7 Kafka source to pull data out of Apache Kafka into my AbstractSink . 我正在使用Flume 1.7 Kafka source将数据从Apache Kafka AbstractSinkAbstractSink In the past I could re-start the offsets at the beginning of the topic by deleting the topic offsets using ./kafka-consumer-groups.sh --delete but since Flume 1.7 (apparently) uses a "new" consumer, attempting ./kafka-consumer-groups.sh --delete now gives the following error message: 过去,我可以通过使用./kafka-consumer-groups.sh --delete删除主题偏移量来重新开始主题偏移量,但是由于Flume 1.7(显然)使用了“新”使用者,因此尝试使用./kafka-consumer-groups.sh --delete现在会显示以下错误消息:

Option [delete] is not valid with [new-consumer]. 选项[删除]对[新消费者]无效。 Note that there's no need to delete group metadata for the new consumer as it is automatically deleted when the last member leaves 请注意,无需删除新使用者的组元数据,因为当最后一个成员离开时会自动将其删除

So, what is the recommended method of achieving the desired behavior (which is that we will re-process the data from the beginning of the topic) ? 那么,建议的实现所需行为的方法是什么(这就是我们将从主题开始重新处理数据)?

Here is part of my flume config: 这是我的水槽配置的一部分:

myagent.sources.my-kafka-source.type = org.apache.flume.source.kafka.KafkaSource
myagent.sources.my-kafka-source.kafka.bootstrap.servers = kafka.example.net:9092
myagent.sources.my-kafka-source.kafka.consumer.group.id = my-gid
myagent.sources.my-kafka-source.kafka.topics = my.topic
myagent.sources.my-kafka-source.kafka.auto.offset.reset = earliest
myagent.sources.my-kafka-source.channels = my_channel

Flume does not offer direct support to the rewind feature although kafka does ships with KafkaConsumer#seek allowing you to re-consume the messages. 尽管kafka随KafkaConsumer#seek一起提供,但Flume不直接支持倒带功能,允许您重新使用消息。 Seems you have to use a new group id to do this which needs to restart the Flume agent. 似乎您必须使用新的组ID来执行此操作,这需要重新启动Flume代理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM