一个集群中有多少个Kafka控制器,控制器的目的是什么? [英] How many Kafka controllers are there in a cluster and what is the purpose of a controller?

查看:40
本文介绍了一个集群中有多少个Kafka控制器,控制器的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Kafka集群中的Kafka控制器负责管理分区领导者和复制.

The Kafka controller in a Kafka cluster is in charge of managing partition leaders and replication.

如果Kafka集群中有100个经纪人,那么控制者仅仅是一个Kafka经纪人吗?那么在100个经纪人中,控制者是领导者吗?

If there are 100 brokers in a Kafka cluster, is the controller just one Kafka broker? So out of the 100 brokers, is the controller the leader?

您怎么知道控制者是哪个经纪人?

How would you know which broker is the controller?

Kafka Controller的管理对Kafka系统管理至关重要吗?

Is the management of the Kafka Controller critical to Kafka system management?

推荐答案

在Kafka群集中,单个代理充当活动控制器,负责分区和副本的状态管理.因此,在您的情况下,如果您有一个包含100个代理的集群,则其中一个将充当控制者.

Within a Kafka cluster, a single broker serves as the active controller which is responsible for state management of partitions and replicas. So in your case, if you have a cluster with 100 brokers, one of them will act as the controller.

可以在此处.

首先要找到哪个代理是集群的控制器,首先需要通过ZK CLI连接到Zookeeper:

In order to find which broker is the controller of a cluster you first need to connect to Zookeeper through ZK CLI:

./bin/zkCli.sh -server localhost:2181 

然后获取控制器

[zk: localhost:2181(CONNECTED) 0] get /controller

输出应类似于以下内容:

The output should look like the one below:

{"version":1,"brokerid":100,"timestamp":"1506423376977"}
cZxid = 0x191
ctime = Tue Sep 26 12:56:16 CEST 2017
mZxid = 0x191
mtime = Tue Sep 26 12:56:16 CEST 2017
pZxid = 0x191
cversion = 0
dataVersion = 0
aclVersion = 0
ephemeralOwner = 0x15ebdd241840002
dataLength = 56
numChildren = 0


Zookeeper是Kafka集群状态的存储.它在开始时或当前控制器崩溃时用于控制器选择.当主题的分区领导者失败/崩溃时,控制器还负责告诉其他副本成为分区领导者.


Zookeeper is the storage of the state of a Kafka cluster. It is used for the controller election either in the very beginning or when the current controller crashes. The controller is also responsible for telling other replicas to become partition leaders when the partition leader broker of a topic fails/crashes.

这篇关于一个集群中有多少个Kafka控制器,控制器的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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