The only downside to that approach is that you consider you have apriori 
knowledge of the ip’s of the master. But if you are doing that from an external 
application and the nodes goes up and down the same ip/master/state.json can’t 
be conceived as granted. I used to go down that path, but if you want more 
dynamic behaviour extracting this way the leader in my mind makes more sense. 
Still proposal 100% functional and working :) worked like that for several 
weeks :D

Nikolaos Ballas  |  Software Development Manager

Technology Nexus S.a.r.l.
2-4 Rue Eugene Rupert
2453 Luxembourg
Delivery address: 2-3 Rue Eugene Rupert,Vertigo Polaris Building
Tel: + 3522619113580
[email protected]<mailto:[email protected]> | 
nexusgroup.com<http://www.nexusgroup.com/>
LinkedIn.com<http://www.linkedin.com/company/nexus-technology> | 
Twitter<http://www.twitter.com/technologynexus> | 
Facebook.com<https://www.facebook.com/pages/Technology-Nexus/133756470003189>


[cid:19B646FC-B8E7-4F77-BBD3-75DD7B4B5BF7]

On 07 Jul 2015, at 15:20, Philippe Laflamme 
<[email protected]<mailto:[email protected]>> wrote:

Querying for /master/state.json will provide you with the master. So you can 
query any one of the hosts in your list of potential masters, extract the 
master information from that and then hit your master on the endpoint you're 
interested in.

Philippe

On Tue, Jul 7, 2015 at 9:02 AM, Donald Laidlaw 
<[email protected]<mailto:[email protected]>> wrote:
Has anyone ever developed Java code to detect the mesos masters and leader, 
given a zookeeper connection?

The reason I ask is because I would like to monitor mesos to report various 
metrics reported by the master. This requires detecting and tracking the 
leading master to query its /metrics/snapshot REST endpoint.

Thanks,
-Don


Reply via email to