Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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