本文介绍了Camus Migration - Kafka HDFS Connect 没有从设置的偏移量开始的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用 Confluent HDFS Sink Connector (v4.0.0) 来替换 Camus.我们正在处理敏感数据,因此我们需要在切换到连接器期间保持偏移量的一致性.

I am currently using Confluent HDFS Sink Connector (v4.0.0) to replace Camus. We are dealing with sensitive data so we need to maintain consistency in offset during cutover to connectors.

转换计划:

  1. 我们创建了 hdfs 接收器连接器并订阅了一个写入临时 hdfs 文件的主题.这将创建一个名为 connect-
  2. 的消费者组
  3. 使用 DELETE 请求停止连接器.
  4. 使用 /usr/bin/kafka-consumer-groups 脚本,我可以将连接器消费者组 kafka 主题分区的当前偏移量设置为所需的值(即加缪写的最后一个偏移量 + 1).
  5. 当我重新启动 hdfs 接收器连接器时,它会继续从上次提交的连接器偏移量读取并忽略设置值.我期待 hdfs 文件名是这样的:hdfs_kafka_topic_name+kafkapartition+Camus_offset+Camus_offset_plus_flush_size.format

我对融合连接器行为的期望是否正确?

Is my expectation of confluent connector behavior correct ?

推荐答案

当您重新启动此连接器时,它将使用写入 hdfs 的最后一个文件的文件中嵌入的偏移量.它不会使用消费者组偏移量.这样做是因为它使用预写日志来实现一次交付到 hdfs.

When you restart this connector, it will use the offset embedded in the file have of the last file written to hdfs. It will not use the consumer group offset. It does this because it uses a write ahead log to achieve exactly once deliver to hdfs.

这篇关于Camus Migration - Kafka HDFS Connect 没有从设置的偏移量开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 20:20