Re: Recommended way to discover current master

2015-08-31 Thread Philip Weaver
oh, nice!

On Mon, Aug 31, 2015 at 1:44 PM, Christos Kozyrakis 
wrote:

> If you have mesos DNS there, access leader.mesos :)
>
> Sent from Christos' phone.
>
> > On Aug 31, 2015, at 10:25 AM, Philip Weaver 
> wrote:
> >
> > My framework knows the list of zookeeper hosts and the list of mesos
> master hosts.
> >
> > I can think of a few ways for the framework to figure out which host is
> the current master. What would be the best? Should I check in zookeeper
> directly? Does the mesos library expose an interface to discover the master
> from zookeeper or otherwise? Should I just try each possible master until
> one responds?
> >
> > Apologies if this is already well documented, but I wasn't able to find
> it. Thanks!
> >
> > - Philip
> >
>


Re: Recommended way to discover current master

2015-08-31 Thread Christos Kozyrakis
If you have mesos DNS there, access leader.mesos :)

Sent from Christos' phone. 

> On Aug 31, 2015, at 10:25 AM, Philip Weaver  wrote:
> 
> My framework knows the list of zookeeper hosts and the list of mesos master 
> hosts.
> 
> I can think of a few ways for the framework to figure out which host is the 
> current master. What would be the best? Should I check in zookeeper directly? 
> Does the mesos library expose an interface to discover the master from 
> zookeeper or otherwise? Should I just try each possible master until one 
> responds?
> 
> Apologies if this is already well documented, but I wasn't able to find it. 
> Thanks!
> 
> - Philip
> 


Re: Recommended way to discover current master

2015-08-31 Thread Connor Doyle
It's also worth noting the existence of the `mesos-resolve` binary, which can 
turn a canonical Mesos ZK string into the leading master location.
--
Connor


> On Aug 31, 2015, at 10:39, Marco Massenzio  wrote:
> 
> The easiest way is via accessing directly Zookeeper - as you don't need to 
> know a priori the list of Masters; if you do, however, hitting any one of 
> them will redirect (302) to the current Leader.
> 
> If you would like to see an example of how to retrieve that info from ZK, I 
> have written about it here[0].
> Finally, we're planning to make all this available via the Mesos Commons[1] 
> library (currently, there is a PR[2] waiting to be be merged).
> 
> 
> [0] 
> http://codetrips.com/2015/08/16/apache-mesos-leader-master-discovery-using-zookeeper-part-2/
> [1] https://github.com/mesos/commons
> [2] https://github.com/mesos/commons/pull/2/files
> 
> Marco Massenzio
> Distributed Systems Engineer
> http://codetrips.com
> 
> On Mon, Aug 31, 2015 at 10:25 AM, Philip Weaver  
> wrote:
> My framework knows the list of zookeeper hosts and the list of mesos master 
> hosts.
> 
> I can think of a few ways for the framework to figure out which host is the 
> current master. What would be the best? Should I check in zookeeper directly? 
> Does the mesos library expose an interface to discover the master from 
> zookeeper or otherwise? Should I just try each possible master until one 
> responds?
> 
> Apologies if this is already well documented, but I wasn't able to find it. 
> Thanks!
> 
> - Philip
> 
> 



Re: Recommended way to discover current master

2015-08-31 Thread Philip Weaver
Excellent, thank you both!

On Mon, Aug 31, 2015 at 10:39 AM, Marco Massenzio 
wrote:

> The easiest way is via accessing directly Zookeeper - as you don't need to
> know a priori the list of Masters; if you do, however, hitting any one of
> them will redirect (302) to the current Leader.
>
> If you would like to see an example of how to retrieve that info from ZK,
> I have written about it here[0].
> Finally, we're planning to make all this available via the Mesos
> Commons[1] library (currently, there is a PR[2] waiting to be be merged).
>
>
> [0]
> http://codetrips.com/2015/08/16/apache-mesos-leader-master-discovery-using-zookeeper-part-2/
> [1] https://github.com/mesos/commons
> [2] https://github.com/mesos/commons/pull/2/files
>
> *Marco Massenzio*
>
> *Distributed Systems Engineerhttp://codetrips.com *
>
> On Mon, Aug 31, 2015 at 10:25 AM, Philip Weaver 
> wrote:
>
>> My framework knows the list of zookeeper hosts and the list of mesos
>> master hosts.
>>
>> I can think of a few ways for the framework to figure out which host is
>> the current master. What would be the best? Should I check in zookeeper
>> directly? Does the mesos library expose an interface to discover the master
>> from zookeeper or otherwise? Should I just try each possible master until
>> one responds?
>>
>> Apologies if this is already well documented, but I wasn't able to find
>> it. Thanks!
>>
>> - Philip
>>
>>
>


Re: Recommended way to discover current master

2015-08-31 Thread Marco Massenzio
The easiest way is via accessing directly Zookeeper - as you don't need to
know a priori the list of Masters; if you do, however, hitting any one of
them will redirect (302) to the current Leader.

If you would like to see an example of how to retrieve that info from ZK, I
have written about it here[0].
Finally, we're planning to make all this available via the Mesos Commons[1]
library (currently, there is a PR[2] waiting to be be merged).


[0]
http://codetrips.com/2015/08/16/apache-mesos-leader-master-discovery-using-zookeeper-part-2/
[1] https://github.com/mesos/commons
[2] https://github.com/mesos/commons/pull/2/files

*Marco Massenzio*

*Distributed Systems Engineerhttp://codetrips.com *

On Mon, Aug 31, 2015 at 10:25 AM, Philip Weaver 
wrote:

> My framework knows the list of zookeeper hosts and the list of mesos
> master hosts.
>
> I can think of a few ways for the framework to figure out which host is
> the current master. What would be the best? Should I check in zookeeper
> directly? Does the mesos library expose an interface to discover the master
> from zookeeper or otherwise? Should I just try each possible master until
> one responds?
>
> Apologies if this is already well documented, but I wasn't able to find
> it. Thanks!
>
> - Philip
>
>


Re: Recommended way to discover current master

2015-08-31 Thread James Peach

> On Aug 31, 2015, at 10:25 AM, Philip Weaver  wrote:
> 
> My framework knows the list of zookeeper hosts and the list of mesos master 
> hosts.
> 
> I can think of a few ways for the framework to figure out which host is the 
> current master. What would be the best? Should I check in zookeeper directly? 
> Does the mesos library expose an interface to discover the master from 
> zookeeper or otherwise? Should I just try each possible master until one 
> responds?

If you want to do it the HTTP way, just hit the /master/redirect enndpoint on 
any master that you can reach.

> 
> Apologies if this is already well documented, but I wasn't able to find it. 
> Thanks!
> 
> - Philip
> 



Recommended way to discover current master

2015-08-31 Thread Philip Weaver
My framework knows the list of zookeeper hosts and the list of mesos master
hosts.

I can think of a few ways for the framework to figure out which host is the
current master. What would be the best? Should I check in zookeeper
directly? Does the mesos library expose an interface to discover the master
from zookeeper or otherwise? Should I just try each possible master until
one responds?

Apologies if this is already well documented, but I wasn't able to find it.
Thanks!

- Philip