Balancing leadership
Whenever a broker stops or crashes leadership for that broker's partitions transfers to other replicas. This means that by default when the broker is restarted it will only be a follower for all its partitions, meaning it will not be used for client reads and writes.
To avoid this imbalance, Kafka has a notion of preferred replicas. If the list of replicas for a partition is 1,5,9 then node 1 is preferred as the leader to either node 5 or 9 because it is earlier in the replica list. You can have the Kafka cluster try to restore leadership to the restored replicas by running the command:
> bin/kafka-preferred-replica-election.sh --zookeeper zk_host:port/chroot
Since running this command can be tedious you can also configure Kafka to do this automatically by setting the following configuration:
auto.leader.rebalance.enable=true
配置:
auto.leader.rebalance.enable 默认值:false
如果设为true,复制控制器会周期性的自动尝试,为所有的broker的每个partition平衡leadership,为更优先(preferred)的replica分配leadership。
leader.imbalance.per.broker.percentage 默认值:10
每个broker允许的不平衡的leader的百分比。如果每个broker超过了这个百分比,复制控制器会重新平衡leadership。
leader.imbalance.check.interval.seconds 默认值:300
检测leader不平衡的时间间隔。
相关推荐
Kafka Leader 倾斜
kafka kafka kafka kafka kafka
kafka
kafka连接工具
kafka kafka kafka
一共包含两个程序,分别是Kafka生产者工具、Kafka消费者工具。 1、使用bootstrap、userName、password连接kafka。 2、可使用text、json格式发送topic消息。 3、异步producer、customer,收发消息畅通无阻。 Kafka...
Kafka自LinkedIn开源以来就以高性能、高吞吐量、分布式的特性著称,本书以0.10版本的源码为基础,深入分析了Kafka的设计与实现,包括生产者和消费者的消息处理流程,新旧消费者不同的设计方式,存储层的实现,协调者...
kafka 插件
Kafka自LinkedIn开源以来就以高性能、高吞吐量、分布式的特性著称,本书以0.10版本的源码为基础,深入分析了Kafka的设计与实现,包括生产者和消费者的消息处理流程,新旧消费者不同的设计方式,存储层的实现,协调者...
kafka的docker镜像包含了kafka,zookeeper 和kafkamanager,可以通过docker 来load 安装
kafka_2.11-2.0.0.tgz, kafka_2.11-2.0.1.tgz, kafka_2.11-2.1.0.tgz, kafka_2.11-2.1.1.tgz, kafka_2.11-2.2.0.tgz, kafka_2.11-2.2.1.tgz, kafka_2.11-2.2.2.tgz, kafka_2.11-2.3.0.tgz, kafka_2.11-2.3.1.tgz, ...
基于Kafka的管理系统源码 基于Kafka的管理系统源码 基于Kafka的管理系统源码 基于Kafka的管理系统源码 基于Kafka的管理系统源码 基于Kafka的管理系统源码 基于Kafka的管理系统源码 基于Kafka的管理系统源码 ...
1、图形化界面可以直观地查看 Kafka 的 Topic 里的内容 2、自由设置 Kafka 数据展示格式 3、使用 Kafka Tool 创建/删除 Topic 4、使用 Kafka Tool 模拟发送 Messages
【BAT必备】kafka面试题【BAT必备】kafka面试题【BAT必备】kafka面试题【BAT必备】kafka面试题【BAT必备】kafka面试题【BAT必备】kafka面试题【BAT必备】kafka面试题【BAT必备】kafka面试题【BAT必备】kafka面试题...
自定义分区的生产者.avi 15_尚硅谷_Kafka_高级消费者.avi 16_尚硅谷_Kafka_低级消费者API思路梳理.avi 17_尚硅谷_Kafka_低级API参数设置.avi 18_尚硅谷_Kafka_低级API之获取分区leader.avi 19_尚硅谷_Kafka_低级API...
kafka-map是一个连接kafka的页面工具
5、kafka监控工具Kafka-Eagle介绍及使用 网址:https://blog.csdn.net/chenwewi520feng/article/details/130581571 本文主要介绍了kafka监控工具Kafka-Eagle的使用。 本文依赖:kafka、zookeeper部署完成。 本分分为...
kafka安装包及安装步骤(原始安装及docker安装)
kafka
版本kafka_2.13-2.5.0. 官网下载太慢了,备份一下. 直接可以用 启动方法 方法一:加守护进程启动 bin/kafka-server-start.sh -daemon config/server.properties 方法二:通过后台来启动 nohup kafka-server-start.sh ...