模拟宕机后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也能自动恢复了

相关推荐
喜欢猪猪2 小时前
深度解析ElasticSearch:构建高效搜索与分析的基石原创
分布式
码上一元2 小时前
消息队列:如何确保消息不会丢失?
kafka·消息队列·rocketmq
蘑菇蘑菇不会开花~3 小时前
分布式Redis(14)哈希槽
redis·分布式·哈希算法
问道飞鱼4 小时前
分布式中间件-Pika一个高效的分布式缓存组件
分布式·缓存·中间件
小宋10215 小时前
玩转RabbitMQ声明队列交换机、消息转换器
服务器·分布式·rabbitmq
懒洋洋的华36911 小时前
消息队列-Kafka(概念篇)
分布式·中间件·kafka
March€11 小时前
分布式事务的基本实现
分布式
DieSnowK13 小时前
[Redis][环境配置]详细讲解
数据库·redis·分布式·缓存·环境配置·新手向·详细讲解
Lill_bin13 小时前
深入理解ElasticSearch集群:架构、高可用性与数据一致性
大数据·分布式·elasticsearch·搜索引擎·zookeeper·架构·全文检索
happycao12315 小时前
kafka之路-01从零搭建环境到SpringBoot集成
kafka