You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mesos.apache.org by Ajay V <aj...@gmail.com> on 2018/03/06 05:54:39 UTC

Get leading master from zookeeper

Hello,

Is there a write up somewhere that I may have missed finding that talks
about how to find the leading master given the zookeeper url? I can find
that there are json.info_.. MasterInfo jsons available in zk, but how can I
translate this to figure out the leading master at any given point in time?

Regards,
Ajay

Re: Get leading master from zookeeper

Posted by Ajay V <aj...@gmail.com>.
Oh great. This should work. Thank you for pointing this out :)

Regards,
Ajay

On Tue, Mar 6, 2018 at 8:53 AM, Zhitao Li <zh...@gmail.com> wrote:

> Mesos implemented the official ZK election recipe
> <https://zookeeper.apache.org/doc/current/recipes.html#sc_leaderElection>,
> so you should expect a list of ephemeral ZNones under your election path
> (often `mesos` but up to your config).
>
> The one with lowest suffix sequence number has the content of leader
> address (in JSON format)
>
> Hope this is useful.
>
> On Mon, Mar 5, 2018 at 9:54 PM, Ajay V <aj...@gmail.com> wrote:
>
>> Hello,
>>
>> Is there a write up somewhere that I may have missed finding that talks
>> about how to find the leading master given the zookeeper url? I can find
>> that there are json.info_.. MasterInfo jsons available in zk, but how can I
>> translate this to figure out the leading master at any given point in time?
>>
>> Regards,
>> Ajay
>>
>
>
>
> --
> Cheers,
>
> Zhitao Li
>

Re: Get leading master from zookeeper

Posted by Zhitao Li <zh...@gmail.com>.
Mesos implemented the official ZK election recipe
<https://zookeeper.apache.org/doc/current/recipes.html#sc_leaderElection>,
so you should expect a list of ephemeral ZNones under your election path
(often `mesos` but up to your config).

The one with lowest suffix sequence number has the content of leader
address (in JSON format)

Hope this is useful.

On Mon, Mar 5, 2018 at 9:54 PM, Ajay V <aj...@gmail.com> wrote:

> Hello,
>
> Is there a write up somewhere that I may have missed finding that talks
> about how to find the leading master given the zookeeper url? I can find
> that there are json.info_.. MasterInfo jsons available in zk, but how can I
> translate this to figure out the leading master at any given point in time?
>
> Regards,
> Ajay
>



-- 
Cheers,

Zhitao Li

Re: Get leading master from zookeeper

Posted by Dan Leary <dl...@touchplan.io>.
Don't know what the official recommendation is or if there is one.
But what I currently do is deserialize the MasterInfos from zk, then use
the Operator API to attempt a GET_MASTER from each one until I get an
answer.
Relies on the "json.info" constant defined in src/master/constants.hpp and
the fact that MasterInfos are serialized there.
Works in 1.5.0 anyway.

-Dan


On Tue, Mar 6, 2018 at 12:54 AM, Ajay V <aj...@gmail.com> wrote:

> Hello,
>
> Is there a write up somewhere that I may have missed finding that talks
> about how to find the leading master given the zookeeper url? I can find
> that there are json.info_.. MasterInfo jsons available in zk, but how can I
> translate this to figure out the leading master at any given point in time?
>
> Regards,
> Ajay
>

RE: Get leading master from zookeeper

Posted by "Mclain, Warren" <wa...@optum.com>.
Does this help ????

cat <your program name>
#!/bin/bash
echo "Checking <one of the zk’s.>"
ssh <host> 'echo stat | nc localhost 2181 | grep Mode'
echo "Checking <host>"
ssh <host> 'echo stat | nc localhost 2181 | grep Mode'
echo "Checking <host>"
ssh <host> 'echo stat | nc localhost 2181 | grep Mode'

typically this is run from the bootstrap that has ssh keys but you get the idea. The 3 hosts are the zookeepers

Please do pass this out to the world.


___________________________________
Warren McLain
Enterprise Engineering Services
IEI Foundation Engineering - Compute, Optum Technology
 warren_mclain@optum.com Office: 763-744-3107

From: Ajay V [mailto:ajayveee@gmail.com]
Sent: Monday, March 05, 2018 11:55 PM
To: user@mesos.apache.org
Subject: Get leading master from zookeeper

Hello,

Is there a write up somewhere that I may have missed finding that talks about how to find the leading master given the zookeeper url? I can find that there are json.info_.. MasterInfo jsons available in zk, but how can I translate this to figure out the leading master at any given point in time?

Regards,
Ajay

This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.