模拟宕机后kafka的重新分区

直接停掉192.168.233.133:9092 (broker.id = 5)

查看topic 分区

复制代码
$ /data/kafka_2.13-3.0.0/bin/kafka-topics.sh --bootstrap-server 192.168.233.132:9092 --topic quickstart77-events --describe
Topic: quickstart77-events	TopicId: A7bNWYseSNqlGfs1XPhN9g	PartitionCount: 6	ReplicationFactor: 2	Configs: segment.bytes=1073741824
	Topic: quickstart77-events	Partition: 0	Leader: 4	Replicas: 5,4	Isr: 4
	Topic: quickstart77-events	Partition: 1	Leader: 1	Replicas: 1,2	Isr: 1,2
	Topic: quickstart77-events	Partition: 2	Leader: 4	Replicas: 4,3	Isr: 4,3
	Topic: quickstart77-events	Partition: 3	Leader: 2	Replicas: 2,0	Isr: 2,0
	Topic: quickstart77-events	Partition: 4	Leader: 3	Replicas: 3,5	Isr: 3
	Topic: quickstart77-events	Partition: 5	Leader: 0	Replicas: 0,1	Isr: 0,1

宕掉的broker已经不在leader和Isr中,Replicas依然还在

恢复192.168.233.133:9092 (broker.id = 5)

复制代码
$ /data/kafka_2.13-3.0.0/bin/kafka-topics.sh --bootstrap-server 192.168.233.132:9092 --topic quickstart77-events --describe
Topic: quickstart77-events	TopicId: A7bNWYseSNqlGfs1XPhN9g	PartitionCount: 6	ReplicationFactor: 2	Configs: segment.bytes=1073741824
	Topic: quickstart77-events	Partition: 0	Leader: 4	Replicas: 5,4	Isr: 4,5
	Topic: quickstart77-events	Partition: 1	Leader: 1	Replicas: 1,2	Isr: 1,2
	Topic: quickstart77-events	Partition: 2	Leader: 4	Replicas: 4,3	Isr: 4,3
	Topic: quickstart77-events	Partition: 3	Leader: 2	Replicas: 2,0	Isr: 2,0
	Topic: quickstart77-events	Partition: 4	Leader: 3	Replicas: 3,5	Isr: 3,5
	Topic: quickstart77-events	Partition: 5	Leader: 0	Replicas: 0,1	Isr: 0,1

Isr中已经恢复看到了,但是leader中还是没有

再过一段时间再观察

复制代码
$ /data/kafka_2.13-3.0.0/bin/kafka-topics.sh --bootstrap-server 192.168.233.132:9092 --topic quickstart77-events --describe
Topic: quickstart77-events	TopicId: A7bNWYseSNqlGfs1XPhN9g	PartitionCount: 6	ReplicationFactor: 2	Configs: segment.bytes=1073741824
	Topic: quickstart77-events	Partition: 0	Leader: 5	Replicas: 5,4	Isr: 4,5
	Topic: quickstart77-events	Partition: 1	Leader: 1	Replicas: 1,2	Isr: 1,2
	Topic: quickstart77-events	Partition: 2	Leader: 4	Replicas: 4,3	Isr: 4,3
	Topic: quickstart77-events	Partition: 3	Leader: 2	Replicas: 2,0	Isr: 2,0
	Topic: quickstart77-events	Partition: 4	Leader: 3	Replicas: 3,5	Isr: 3,5
	Topic: quickstart77-events	Partition: 5	Leader: 0	Replicas: 0,1	Isr: 0,1

leader也能自动恢复了

相关推荐
JAVA学习通3 分钟前
【RabbitMQ】----RabbitMQ 的7种工作模式
分布式·rabbitmq
励志成为糕手1 小时前
Hadoop进程:深入理解分布式计算引擎的核心机制
大数据·hadoop·分布式·mapreduce·yarn
掘金-我是哪吒1 小时前
分布式微服务系统架构第170集:Kafka消费者并发-多节点消费-可扩展性
分布式·微服务·架构·kafka·系统架构
何双新1 小时前
第 3 讲:KAFKA生产者(Producer)详解
分布式·kafka·linq
Heliotrope_Sun2 小时前
RabbitMQ
分布式·rabbitmq
KIDAKN3 小时前
Redis 分布式锁
数据库·redis·分布式
KIDAKN3 小时前
RabbitMQ 工作模式
分布式·rabbitmq
百思可瑞教育3 小时前
ActiveMQ、RocketMQ、RabbitMQ、Kafka 的全面对比分析
vue.js·分布式·rabbitmq·rocketmq·activemq·北京百思可瑞教育·百思可瑞教育
KIDAKN10 小时前
RabbitMQ 初步认识
分布式·rabbitmq
pan30350747910 小时前
Kafka 和 RabbitMQ的选择
分布式·kafka·rabbitmq