0
votes

I am using a 3 broker Kafka cluster in prod. Earlier the replication factor was 2 . Now I want to increase the replication factor to 3. I have executed the kafka-reassignment-partions.sh file and it go executed successfully. Post execution when I am executing the describe command it is showing 3 brokers in the ISR list , but for all partions , I am having the same leader (Broker 1 as the Leader).

Please suggest

1
Can you provide 1) how did you execute the reassignment, so the JSON file describing it 2) how many topics do you have and the describe command output you are talking about ?ppatierno
hello @ppatierno in the current test env , I am having total 16 topics and each topic contains 246 partitions numbered from 0 to 245. I picked up one topic in random , and used kafka-reassign-partitions with the supporting json file.D Developer
So you are saying that for all the 16 topics ... all the 246 partitions have just broker 1 as leader and the other two brokers are just followers ?ppatierno
@ppatierno , I am currently testing for 1 topic . My current cluster contains 3 brokers with replication factor as 2. I need to increase the replication factor to 3 runtime. I am using the JSON (partly attached) , replication factor is increasing to 3 and in the ISR list , I can see 3 brokers. In the leader section I am getting only broker 1 as the leader for all the 246 partitions.D Developer
I cannot see the JSON you are talking about :-(ppatierno

1 Answers

1
votes

As far as I know the order you put in the "replicas" field reflect which broker will be the leader for that partition so have the same [1,2,3] sequence for all the partitions and broker 1 is always in the same first position so it will be the leader for that partition. You should change that order putting in the first position the broker-id you want being the leader for the corresponding partition. After that you have to run the preferred replica election tool.