You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Monika Garg <ga...@gmail.com> on 2013/10/22 09:20:30 UTC

Leader = -1 is coming when broker goes down

Hi

I have made 2 nodes kafka cluster and created a topic with 3 partitions and
1 replica.

the partitions got distributed among 2 brokers.

then one of my broker(broker1) goes down and due to this the
partition(partition2) for which broker1 was acting as a leader,now showing
me the leader value as -1 by the kafka-list-topic-command.

Any clue for leader coming as -1.

-- 
*Moniii*

Re: Leader = -1 is coming when broker goes down

Posted by Neha Narkhede <ne...@gmail.com>.
If all replicas for a partition go offline, then leader will be set to -1.

Thanks,
Neha
On Nov 20, 2013 1:45 AM, "Monika Garg" <ga...@gmail.com> wrote:

> Hi Neha,
>
> In context of the same mail thread that you have already answered,I just
> want to clear one more doubt:
>
> If I am making a cluster with two brokers and a topic with 3 partitions and
> two replicas,then
> can leader = -1 come here in any case?
>
>
>
> On Tue, Oct 22, 2013 at 10:55 PM, Monika Garg <ga...@gmail.com>
> wrote:
>
> > Thanks Neha.
> >
> >
> >
> >
> > On Tue, Oct 22, 2013 at 7:39 PM, Neha Narkhede <neha.narkhede@gmail.com
> >wrote:
> >
> >> You have picked replication factor of 1, so when you bring down the only
> >> replica which can be the leader, it cannot be moved elsewhere. So we set
> >> it
> >> to -1.
> >>
> >> Thanks,
> >> Neha
> >> On Oct 22, 2013 12:21 AM, "Monika Garg" <ga...@gmail.com> wrote:
> >>
> >> > Hi
> >> >
> >> > I have made 2 nodes kafka cluster and created a topic with 3
> partitions
> >> and
> >> > 1 replica.
> >> >
> >> > the partitions got distributed among 2 brokers.
> >> >
> >> > then one of my broker(broker1) goes down and due to this the
> >> > partition(partition2) for which broker1 was acting as a leader,now
> >> showing
> >> > me the leader value as -1 by the kafka-list-topic-command.
> >> >
> >> > Any clue for leader coming as -1.
> >> >
> >> > --
> >> > *Moniii*
> >> >
> >>
> >
> >
> >
> > --
> > *Moniii*
> >
>
>
>
> --
> *Moniii*
>

Re: Leader = -1 is coming when broker goes down

Posted by Monika Garg <ga...@gmail.com>.
Hi Neha,

In context of the same mail thread that you have already answered,I just
want to clear one more doubt:

If I am making a cluster with two brokers and a topic with 3 partitions and
two replicas,then
can leader = -1 come here in any case?



On Tue, Oct 22, 2013 at 10:55 PM, Monika Garg <ga...@gmail.com> wrote:

> Thanks Neha.
>
>
>
>
> On Tue, Oct 22, 2013 at 7:39 PM, Neha Narkhede <ne...@gmail.com>wrote:
>
>> You have picked replication factor of 1, so when you bring down the only
>> replica which can be the leader, it cannot be moved elsewhere. So we set
>> it
>> to -1.
>>
>> Thanks,
>> Neha
>> On Oct 22, 2013 12:21 AM, "Monika Garg" <ga...@gmail.com> wrote:
>>
>> > Hi
>> >
>> > I have made 2 nodes kafka cluster and created a topic with 3 partitions
>> and
>> > 1 replica.
>> >
>> > the partitions got distributed among 2 brokers.
>> >
>> > then one of my broker(broker1) goes down and due to this the
>> > partition(partition2) for which broker1 was acting as a leader,now
>> showing
>> > me the leader value as -1 by the kafka-list-topic-command.
>> >
>> > Any clue for leader coming as -1.
>> >
>> > --
>> > *Moniii*
>> >
>>
>
>
>
> --
> *Moniii*
>



-- 
*Moniii*

Re: Leader = -1 is coming when broker goes down

Posted by Monika Garg <ga...@gmail.com>.
Thanks Neha.




On Tue, Oct 22, 2013 at 7:39 PM, Neha Narkhede <ne...@gmail.com>wrote:

> You have picked replication factor of 1, so when you bring down the only
> replica which can be the leader, it cannot be moved elsewhere. So we set it
> to -1.
>
> Thanks,
> Neha
> On Oct 22, 2013 12:21 AM, "Monika Garg" <ga...@gmail.com> wrote:
>
> > Hi
> >
> > I have made 2 nodes kafka cluster and created a topic with 3 partitions
> and
> > 1 replica.
> >
> > the partitions got distributed among 2 brokers.
> >
> > then one of my broker(broker1) goes down and due to this the
> > partition(partition2) for which broker1 was acting as a leader,now
> showing
> > me the leader value as -1 by the kafka-list-topic-command.
> >
> > Any clue for leader coming as -1.
> >
> > --
> > *Moniii*
> >
>



-- 
*Moniii*

Re: Leader = -1 is coming when broker goes down

Posted by Neha Narkhede <ne...@gmail.com>.
You have picked replication factor of 1, so when you bring down the only
replica which can be the leader, it cannot be moved elsewhere. So we set it
to -1.

Thanks,
Neha
On Oct 22, 2013 12:21 AM, "Monika Garg" <ga...@gmail.com> wrote:

> Hi
>
> I have made 2 nodes kafka cluster and created a topic with 3 partitions and
> 1 replica.
>
> the partitions got distributed among 2 brokers.
>
> then one of my broker(broker1) goes down and due to this the
> partition(partition2) for which broker1 was acting as a leader,now showing
> me the leader value as -1 by the kafka-list-topic-command.
>
> Any clue for leader coming as -1.
>
> --
> *Moniii*
>