You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Amin Sadeghi <sa...@gmail.com> on 2019/01/20 11:17:26 UTC

Failover

Hi
Please help me for kafka failover
https://stackoverflow.com/questions/54274799/kafka-broker-failover-not-worked

Re: Failover

Posted by "M. Manna" <ma...@gmail.com>.
Could you show us the output of Kafka-topics.sh describing your desired
topic status?



On Sun, 20 Jan 2019 at 12:56, M. Manna <ma...@gmail.com> wrote:

> I think you’re slightly confused with what’s going on here.
>
> Your quorum is broken- when it becomes 2 nodes, how does it make sense to
> elect 1 broker and 1 follower ? And why is it that node 1 is the broker,
> not follower?
>
> Your issue is the quorum setup. Your setup can only sustain 1 failure,
> which you have with node0 going down. Heartbeat isn’t the issue here.
>
> Thanks,
>

> On Sun, 20 Jan 2019 at 12:53, Amin Sadeghi <sa...@gmail.com>
> wrote:
>
OK , but after re-election happened , consumers do not consume messages
>>
>> On Sun, Jan 20, 2019 at 4:18 PM suresh sargar <su...@gmail.com>
>> wrote:
>>
>> > Zookeeper checks heartbeat of each node.as soon as ZK not able to get
>> > heartbeat from leader, re-election happens. Heartbeat check interval is
>> > configurable. If u run kafka_topic.sh with describe option u will see
>> newly
>> > elected leader and isr will also updated one.
>> >
>> > On Sun 20 Jan, 2019, 5:53 PM Amin Sadeghi <sadeghi.yaser@gmail.com
>> wrote:
>> >
>> > > Thanks for answers
>> > > But if a leader goes offline , when a follower become leader, in other
>> > > words when a leader of partitions will changed
>> > >
>> > > On Sun, Jan 20, 2019 at 3:03 PM M. Manna <ma...@gmail.com> wrote:
>> > >
>> > > > I’m simply giving my comments but others please correct me if this
>> is
>> > not
>> > > > correct.
>> > > >
>> > > > For Scenario 1 - your leader node0 is offline - and your quorum is
>> now
>> > > not
>> > > > stable. So if a leader goes offline it's not certain who will take
>> > over.
>> > > So
>> > > > that's why 3 is recommended as a minimum, however not the best
>> number
>> > to
>> > > > deploy in production.
>> > > >
>> > > > For Scenario 2 - Your leader node0 is online. So even if node 1 or
>> 2 is
>> > > > stopped, the consumers can get the message from leaders, not
>> followers.
>> > > >
>> > > > So this is not unexpected.
>> > > >
>> > > > Thanks,
>> > > >
>> > > > On Sun, 20 Jan 2019 at 11:17, Amin Sadeghi <sadeghi.yaser@gmail.com
>> >
>> > > > wrote:
>> > > >
>> > > > > Hi
>> > > > > Please help me for kafka failover
>> > > > >
>> > > > >
>> > > >
>> > >
>>
> >
>> https://stackoverflow.com/questions/54274799/Kafka-broker-failover-not-worked
>> <https://stackoverflow.com/questions/54274799/kafka-broker-failover-not-worked>
>> > > > >
>> > > >
>> > >
>> >
>>
>

Re: Failover

Posted by "M. Manna" <ma...@gmail.com>.
I think you’re slightly confused with what’s going on here.

Your quorum is broken- when it becomes 2 nodes, how does it make sense to
elect 1 broker and 1 follower ? And why is it that node 1 is the broker,
not follower?

Your issue is the quorum setup. Your setup can only sustain 1 failure,
which you have with node0 going down. Heartbeat isn’t the issue here.

Thanks,

On Sun, 20 Jan 2019 at 12:53, Amin Sadeghi <sa...@gmail.com> wrote:

> OK , but after re-election happened , consumers do not consume messages
>
> On Sun, Jan 20, 2019 at 4:18 PM suresh sargar <su...@gmail.com>
> wrote:
>
> > Zookeeper checks heartbeat of each node.as soon as ZK not able to get
> > heartbeat from leader, re-election happens. Heartbeat check interval is
> > configurable. If u run kafka_topic.sh with describe option u will see
> newly
> > elected leader and isr will also updated one.
> >
> > On Sun 20 Jan, 2019, 5:53 PM Amin Sadeghi <sadeghi.yaser@gmail.com
> wrote:
> >
> > > Thanks for answers
> > > But if a leader goes offline , when a follower become leader, in other
> > > words when a leader of partitions will changed
> > >
> > > On Sun, Jan 20, 2019 at 3:03 PM M. Manna <ma...@gmail.com> wrote:
> > >
> > > > I’m simply giving my comments but others please correct me if this is
> > not
> > > > correct.
> > > >
> > > > For Scenario 1 - your leader node0 is offline - and your quorum is
> now
> > > not
> > > > stable. So if a leader goes offline it's not certain who will take
> > over.
> > > So
> > > > that's why 3 is recommended as a minimum, however not the best number
> > to
> > > > deploy in production.
> > > >
> > > > For Scenario 2 - Your leader node0 is online. So even if node 1 or 2
> is
> > > > stopped, the consumers can get the message from leaders, not
> followers.
> > > >
> > > > So this is not unexpected.
> > > >
> > > > Thanks,
> > > >
> > > > On Sun, 20 Jan 2019 at 11:17, Amin Sadeghi <sa...@gmail.com>
> > > > wrote:
> > > >
> > > > > Hi
> > > > > Please help me for kafka failover
> > > > >
> > > > >
> > > >
> > >
> >
> https://stackoverflow.com/questions/54274799/kafka-broker-failover-not-worked
> > > > >
> > > >
> > >
> >
>

Re: Failover

Posted by Amin Sadeghi <sa...@gmail.com>.
OK , but after re-election happened , consumers do not consume messages

On Sun, Jan 20, 2019 at 4:18 PM suresh sargar <su...@gmail.com>
wrote:

> Zookeeper checks heartbeat of each node.as soon as ZK not able to get
> heartbeat from leader, re-election happens. Heartbeat check interval is
> configurable. If u run kafka_topic.sh with describe option u will see newly
> elected leader and isr will also updated one.
>
> On Sun 20 Jan, 2019, 5:53 PM Amin Sadeghi <sadeghi.yaser@gmail.com wrote:
>
> > Thanks for answers
> > But if a leader goes offline , when a follower become leader, in other
> > words when a leader of partitions will changed
> >
> > On Sun, Jan 20, 2019 at 3:03 PM M. Manna <ma...@gmail.com> wrote:
> >
> > > I’m simply giving my comments but others please correct me if this is
> not
> > > correct.
> > >
> > > For Scenario 1 - your leader node0 is offline - and your quorum is now
> > not
> > > stable. So if a leader goes offline it's not certain who will take
> over.
> > So
> > > that's why 3 is recommended as a minimum, however not the best number
> to
> > > deploy in production.
> > >
> > > For Scenario 2 - Your leader node0 is online. So even if node 1 or 2 is
> > > stopped, the consumers can get the message from leaders, not followers.
> > >
> > > So this is not unexpected.
> > >
> > > Thanks,
> > >
> > > On Sun, 20 Jan 2019 at 11:17, Amin Sadeghi <sa...@gmail.com>
> > > wrote:
> > >
> > > > Hi
> > > > Please help me for kafka failover
> > > >
> > > >
> > >
> >
> https://stackoverflow.com/questions/54274799/kafka-broker-failover-not-worked
> > > >
> > >
> >
>

Re: Failover

Posted by suresh sargar <su...@gmail.com>.
Zookeeper checks heartbeat of each node.as soon as ZK not able to get
heartbeat from leader, re-election happens. Heartbeat check interval is
configurable. If u run kafka_topic.sh with describe option u will see newly
elected leader and isr will also updated one.

On Sun 20 Jan, 2019, 5:53 PM Amin Sadeghi <sadeghi.yaser@gmail.com wrote:

> Thanks for answers
> But if a leader goes offline , when a follower become leader, in other
> words when a leader of partitions will changed
>
> On Sun, Jan 20, 2019 at 3:03 PM M. Manna <ma...@gmail.com> wrote:
>
> > I’m simply giving my comments but others please correct me if this is not
> > correct.
> >
> > For Scenario 1 - your leader node0 is offline - and your quorum is now
> not
> > stable. So if a leader goes offline it's not certain who will take over.
> So
> > that's why 3 is recommended as a minimum, however not the best number to
> > deploy in production.
> >
> > For Scenario 2 - Your leader node0 is online. So even if node 1 or 2 is
> > stopped, the consumers can get the message from leaders, not followers.
> >
> > So this is not unexpected.
> >
> > Thanks,
> >
> > On Sun, 20 Jan 2019 at 11:17, Amin Sadeghi <sa...@gmail.com>
> > wrote:
> >
> > > Hi
> > > Please help me for kafka failover
> > >
> > >
> >
> https://stackoverflow.com/questions/54274799/kafka-broker-failover-not-worked
> > >
> >
>

Re: Failover

Posted by Amin Sadeghi <sa...@gmail.com>.
Thanks for answers
But if a leader goes offline , when a follower become leader, in other
words when a leader of partitions will changed

On Sun, Jan 20, 2019 at 3:03 PM M. Manna <ma...@gmail.com> wrote:

> I’m simply giving my comments but others please correct me if this is not
> correct.
>
> For Scenario 1 - your leader node0 is offline - and your quorum is now not
> stable. So if a leader goes offline it's not certain who will take over. So
> that's why 3 is recommended as a minimum, however not the best number to
> deploy in production.
>
> For Scenario 2 - Your leader node0 is online. So even if node 1 or 2 is
> stopped, the consumers can get the message from leaders, not followers.
>
> So this is not unexpected.
>
> Thanks,
>
> On Sun, 20 Jan 2019 at 11:17, Amin Sadeghi <sa...@gmail.com>
> wrote:
>
> > Hi
> > Please help me for kafka failover
> >
> >
> https://stackoverflow.com/questions/54274799/kafka-broker-failover-not-worked
> >
>

Re: Failover

Posted by "M. Manna" <ma...@gmail.com>.
I’m simply giving my comments but others please correct me if this is not
correct.

For Scenario 1 - your leader node0 is offline - and your quorum is now not
stable. So if a leader goes offline it's not certain who will take over. So
that's why 3 is recommended as a minimum, however not the best number to
deploy in production.

For Scenario 2 - Your leader node0 is online. So even if node 1 or 2 is
stopped, the consumers can get the message from leaders, not followers.

So this is not unexpected.

Thanks,

On Sun, 20 Jan 2019 at 11:17, Amin Sadeghi <sa...@gmail.com> wrote:

> Hi
> Please help me for kafka failover
>
> https://stackoverflow.com/questions/54274799/kafka-broker-failover-not-worked
>