- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Leader election after replication in Kafka cluster
- Labels:
-
Apache Kafka
-
Apache Zookeeper
Created on ‎01-06-2017 07:07 AM - edited ‎09-16-2022 03:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi guys,
We decided to replace one broker(id=29) in our Kafka cluster.
default.replication.factor: 3
num.partitions: 3
So, we moved all topics from brokers 29,30,31 to 30,31 using kafka-reassign-partitions. Everything was ok
After replication was done we added replaced node(id=32) and moved all topics to brokers 30,31,32
But we see that all partitions have the same leader is 30:
./kafka-topics --topic=Shop --describe --zookeeper=localhost:2181
Topic:Shop PartitionCount:3 ReplicationFactor:3 Configs:
Topic: Shop Partition: 0 Leader: 30 Replicas: 30,32,31 Isr: 31,30,32
Topic: Shop Partition: 1 Leader: 30 Replicas: 32,31,30 Isr: 30,31,32
Topic: Shop Partition: 2 Leader: 30 Replicas: 31,30,32 Isr: 30,31,32
How should we change it?
Thanks
Created on ‎01-06-2017 11:51 AM - edited ‎01-06-2017 11:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Take a look at the preferred leader election tool:
https://cwiki.apache.org/confluence/display/KAFKA/Replication+tools
This assumes that the desired leaders are listed first in the partition list. If 30 is listed first, it will still be the leader for all those partitions.
-pd
Created on ‎01-06-2017 11:51 AM - edited ‎01-06-2017 11:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Take a look at the preferred leader election tool:
https://cwiki.apache.org/confluence/display/KAFKA/Replication+tools
This assumes that the desired leaders are listed first in the partition list. If 30 is listed first, it will still be the leader for all those partitions.
-pd
