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

相关推荐
_oP_i27 分钟前
Pinpoint 是一个开源的分布式追踪系统
java·分布式·开源
lucky_syq2 小时前
Flume和Kafka的区别?
大数据·kafka·flume
观测云3 小时前
Confluent Cloud Kafka 可观测性最佳实践
kafka·confluent
攻心的子乐3 小时前
Kafka可视化工具 Offset Explorer (以前叫Kafka Tool)
分布式·kafka
小林想被监督学习3 小时前
RabbitMQ 的7种工作模式
分布式·rabbitmq
初晴~5 小时前
【Redis分布式锁】高并发场景下秒杀业务的实现思路(集群模式)
java·数据库·redis·分布式·后端·spring·
有一个好名字5 小时前
zookeeper分布式锁模拟12306买票
分布式·zookeeper·云原生
漫无目的行走的月亮6 小时前
Ubuntu下C语言操作kafka示例
kafka·librdkafka
yukai080088 小时前
【最后203篇系列】002 - 两个小坑(容器时间错误和kafka模块报错
分布式·kafka
老猿讲编程9 小时前
OMG DDS 规范漫谈:分布式数据交互的演进之路
分布式·dds