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

相关推荐
jimiStephen6 小时前
ZooKeeper 数据模型
分布式·zookeeper·云原生
翻晒时光8 小时前
设计模式:春招面试的关键知识储备
分布式·面试·职场和发展
大白菜和MySQL10 小时前
rabbitmq单机与集群模式的部署
服务器·分布式·rabbitmq
DEARM LINER10 小时前
RabbitMQ 架构分析
java·分布式·架构·rabbitmq·ruby
cccl.11 小时前
JAVA(SpringBoot)集成Kafka实现消息发送和接收。
spring boot·后端·kafka
霍格沃兹测试开发学社测试人社区11 小时前
性能测试丨分布式性能监控系统 SkyWalking
软件测试·分布式·测试开发·skywalking
DEARM LINER11 小时前
RabbitMQ 分布式高可用
java·spring boot·分布式·rabbitmq
小林想被监督学习13 小时前
RabbitMQ 仲裁队列 -- 解决 RabbitMQ 集群数据不同步的问题
linux·分布式·rabbitmq
栗子~~16 小时前
docker-compose的方式搭建 kafka KRaft 模式集群
docker·kafka·linq
S-X-S17 小时前
RabbitMQ模块新增消息转换器
分布式·rabbitmq