简体   繁体   English

MM2.0消费群体行为

[英]MM2.0 consumer group behavior

I'm trying to run some tests to understand MM2 behavior.我正在尝试运行一些测试来了解 MM2 的行为。 As part of that I had the following questions:作为其中的一部分,我有以下问题:

  1. How to correctly pass a custom consumer group for MM2 in mm2.properties ?如何在mm2.properties中正确传递 MM2 的自定义消费者组?
    Based on this question , tried passing <alias>.group.id=temp_cons_group in mm2.properties and on restarting the MM2 instance could see the consumer group mentioned in the MM2 logs.基于这个问题,尝试在 mm2.properties 中传递<alias>.group.id=temp_cons_group mm2.properties并在重新启动 MM2 实例时可以看到 MM2 日志中提到的消费者组。
    However, when I try listing consumer groups registered in the source broker, the group doesn't show up?但是,当我尝试listing在源代理中注册的消费者组时,该组没有显示?

  2. How to test if the property <alias>.consumer.auto.offset.reset works?如何测试属性<alias>.consumer.auto.offset.reset有效?
    Here, I want to consume the same messages again so in reference to the question , tried setting <source_alias>.consumer.auto.offset.reset to earliest and restarted MM2.在这里,我想再次使用相同的消息,因此参考问题,尝试将<source_alias>.consumer.auto.offset.reset设置为earliest并重新启动 MM2。
    I was able to see the property set correctly in MM2 logs but did not get the messages from the beginning in the target cluster topic.我能够在 MM2 日志中看到正确设置的属性,但没有从目标集群主题的开头获取消息。

  3. How do I start a MM2 instance to start consuming messages from a specific offset for a topic present in the source cluster?如何启动 MM2 实例以开始使用来自源集群中存在的主题的特定偏移量的消息?

  1. MirrorMaker does not use a consumer group to run and instead uses the assign() API, so it's expected that you don't see a group. MirrorMaker 不使用消费者组来运行,而是使用assign() API,因此预计您不会看到组。

  2. It's hard to "test".很难“测试”。 One way to verify this configuration was picked up is to check it's present in the logs when MirrorMaker starts its consumers.验证此配置是否被拾取的一种方法是在 MirrorMaker 启动其使用者时检查它是否存在于日志中。

  3. This is currently not trivial to do.目前这不是一件容易的事。 There's a KIP in progress to improve the process but at the moment it requires manually updating the internal offset topic from your Connect instance.有一个KIP正在进行中以改进流程,但目前它需要从您的 Connect 实例手动更新内部偏移量主题。 At a very high level, here's the process:在一个非常高的层次上,这是一个过程:

    First, ensure MirrorMaker is not running.首先,确保 MirrorMaker 没有运行。 Then you need to find the offset records for MirrorMaker in the offsets topic using a command like:然后您需要使用如下命令在偏移量主题中找到 MirrorMaker 的偏移量记录:

     ./bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 \ --topic <CONNECT_OFFSET_TOPIC \ --from-beginning \ --property print.key=true | grep <SOURCE_CONNECTOR_NAME>

    You will see records with offsets for each partition MirrorMaker handles.您将看到 MirrorMaker 处理的每个分区的偏移记录。 To update the offsets, you need to produce new records to this topic with the offsets you want.要更新偏移量,您需要使用所需的偏移量为该主题生成新记录。 For each partition, ensure your record has the same key as the existing message so it replaces the existing stored offsets.对于每个分区,确保您的记录与现有消息具有相同的键,以便它替换现有的存储偏移量。

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

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