When and how often does Kafka Producer elect a leader?

279 views
Skip to first unread message

Igor Ikarus

unread,
Jul 18, 2017, 4:26:48 AM7/18/17
to Confluent Platform
When and how often does Kafka Producer elect a leader?
(During elect a leader my kafka cluster does not handle new message)

Ewen Cheslack-Postava

unread,
Jul 20, 2017, 6:45:57 PM7/20/17
to Confluent Platform
Under stable state there wouldn't be any leader election. Generally you only need to elect a leader if:

a) the current leader dies (crashes, network partition, etc) and a new leader needs to be selected
b) the "preferred leader" broker is not currently the leader. the preferred leader is just the first replica in the replica list. this only occurs if auto.leader.rebalance.enable=true or if you invoke the kafka-preferred-replica-election script

-Ewen

On Tue, Jul 18, 2017 at 1:26 AM, Igor Ikarus <adm...@gmail.com> wrote:
When and how often does Kafka Producer elect a leader?
(During elect a leader my kafka cluster does not handle new message)

--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/59577629-acdd-4d83-9dab-1c3c9fbf785a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Igor Ikarus

unread,
Jul 28, 2017, 10:50:31 AM7/28/17
to Confluent Platform
Hello Ewen,

 Thank you a lot of for your respons. It was very helpfull. I found out auto.leader.rebalance.enable and in my configuration it's enable by default, also leader.imbalance.check.interval.seconds and leader.imbalance.per.broker.percentage set by default. 

One broker from my cluster have less on 4000 partishions then others (1,2,3,5 around 16600 and 4 around 12600). I can assume that it's root case in my problem.

Igor

On Friday, July 21, 2017 at 1:45:57 AM UTC+3, Ewen Cheslack-Postava wrote:
Under stable state there wouldn't be any leader election. Generally you only need to elect a leader if:

a) the current leader dies (crashes, network partition, etc) and a new leader needs to be selected
b) the "preferred leader" broker is not currently the leader. the preferred leader is just the first replica in the replica list. this only occurs if auto.leader.rebalance.enable=true or if you invoke the kafka-preferred-replica-election script

-Ewen
On Tue, Jul 18, 2017 at 1:26 AM, Igor Ikarus <adm...@gmail.com> wrote:
When and how often does Kafka Producer elect a leader?
(During elect a leader my kafka cluster does not handle new message)

--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages