消费者小组协调员和消费者小组负责人之间的Kafka有什么区别? [英] What is the difference in Kafka between a Consumer Group Coordinator and a Consumer Group Leader?

查看:117
本文介绍了消费者小组协调员和消费者小组负责人之间的Kafka有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到了Kafka消费者小组协调员和消费者小组负责人的引用...

I see references to Kafka Consumer Group Coordinators and Consumer Group Leaders...

  1. 有什么区别?

  1. What is the difference?

将团队管理分为两组不同的职责有什么好处?

What is the benefit from separating group management into two different sets of responsibilities?

推荐答案

消费者组协调员是经纪人之一,而组长是消费者组中的消费者之一.

The consumer group coordinator is one of the brokers while the group leader is one of the consumer in a consumer group.

组协调员不过是从消费者组的所有消费者接收心跳(或轮询消息)的经纪人之一.每个消费者群体都有一个小组协调员.如果消费者停止发送心跳,则协调器将触发重新平衡.

The group coordinator is nothing but one of the brokers which receives heartbeats (or polling for messages) from all consumers of a consumer group. Every consumer group has a group coordinator. If a consumer stops sending heartbeats, the coordinator will trigger a rebalance.

当使用者要加入使用者组时,它将向组协调器发送一个JoinGroup请求.加入该小组的第一个消费者成为小组负责人.领导者从组协调器接收组中所有消费者的列表(这将包括最近发送心跳并因此被认为是活动的所有消费者),并且负责为每个消费者分配分区的子集.它使用PartitionAssignor接口的实现来决定哪个分区应由哪个使用者处理.在确定分区分配之后,消费者负责人将分配列表发送给GroupCoordinator,后者将此信息发送给所有消费者.每个消费者仅看到自己的任务-领导者是唯一拥有该组消费者及其任务的完整列表的客户流程.每当重新平衡时,都会重复此过程.

When a consumer wants to join a consumer group, it sends a JoinGroup request to the group coordinator. The first consumer to join the group becomes the group leader. The leader receives a list of all consumers in the group from the group coordinator (this will include all consumers that sent a heartbeat recently and are therefore considered alive) and it is responsible for assigning a subset of partitions to each consumer. It uses an implementation of the PartitionAssignor interface to decide which partitions should be handled by which consumer. After deciding on the partition assignment, the consumer leader sends the list of assignments to the GroupCoordinator which sends this information to all the consumers. Each consumer only sees his own assignment - the leader is the only client process that has the full list of consumers in the group and their assignments. This process repeats every time a rebalance happens.

这篇关于消费者小组协调员和消费者小组负责人之间的Kafka有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆