消费者组协调员和消费者组负责人之间的 Kafka 有什么区别?
What is the difference in Kafka between a Consumer Group Coordinator and a Consumer Group Leader?
我看到对 Kafka 消费者组协调器和消费者组领导的引用...
有什么区别?
将组管理分成两组不同的职责有什么好处?
1。有什么区别?
consumer group coordinator 是 broker 之一,而 group leader 是 consumer group 中的消费者之一。
组协调器只不过是从消费者组的所有消费者接收心跳(或轮询消息)的代理之一。每个消费者组都有一个组协调器。如果消费者停止发送心跳,协调器将触发重新平衡。
2。将组管理分为两组不同的职责有什么好处?
简答
它为您提供了更多 flexible/extensible 分配策略,而无需重新启动代理。
长答案
这种分离的关键点是组长负责计算整个组的分配。
这意味着可以在消费者上配置此分配策略(参见partition.assignment.strategy
消费者配置参数)。
如果分区分配由消费者组协调器处理,则在不重新启动代理的情况下无法配置自定义分配策略。
有关详细信息,请参阅 Kafka Client-side Assignment Proposal。
文档引述
来自“Kafka The Definitive Guide” [Narkhede, Shapira & Palino, 2017]:
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 消费者组协调器和消费者组领导的引用...
有什么区别?
将组管理分成两组不同的职责有什么好处?
1。有什么区别?
consumer group coordinator 是 broker 之一,而 group leader 是 consumer group 中的消费者之一。
组协调器只不过是从消费者组的所有消费者接收心跳(或轮询消息)的代理之一。每个消费者组都有一个组协调器。如果消费者停止发送心跳,协调器将触发重新平衡。
2。将组管理分为两组不同的职责有什么好处?
简答
它为您提供了更多 flexible/extensible 分配策略,而无需重新启动代理。
长答案
这种分离的关键点是组长负责计算整个组的分配。
这意味着可以在消费者上配置此分配策略(参见partition.assignment.strategy
消费者配置参数)。
如果分区分配由消费者组协调器处理,则在不重新启动代理的情况下无法配置自定义分配策略。
有关详细信息,请参阅 Kafka Client-side Assignment Proposal。
文档引述
来自“Kafka The Definitive Guide” [Narkhede, Shapira & Palino, 2017]:
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 thePartitionAssignor
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.