Support Questions

Find answers, ask questions, and share your expertise

Leader election after replication in Kafka cluster

avatar
Contributor

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

1 ACCEPTED SOLUTION

avatar

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

View solution in original post

1 REPLY 1

avatar

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