Now that Mesos (0.24, to be released soon) publishes the Master info to ZooKeeper in JSON, it should be (relatively) easier to get the info about the leading master directly from there (or even set a Watcher on the znode to be alerted of leadership changes). Not as easy as hitting an HTTP endpoint, granted, but that's just a hard problem to solve anyway.
I'm planning to provide sample code and a blog entry about this soon as I have time, but it won't be before this weekend at the earliest (and more likely the next one). *Marco Massenzio* *Distributed Systems Engineer* On Tue, Aug 4, 2015 at 5:04 PM, Steven Schlansker <[email protected] > wrote: > Unfortunately that sort of solution is also prone to races. > I do not think this is really possible (at least not even remotely > elegantly) to solve externally to Mesos itself. > > On Aug 4, 2015, at 4:49 PM, James DeFelice <[email protected]> > wrote: > > > If you're using mesos-dns I think you can query slave.mesos to get an a > record for each. I believe it responds to srv requests too. > > > > On Aug 4, 2015 7:29 PM, "Steven Schlansker" <[email protected]> > wrote: > > Unfortunately this is racey. If you redirect to a master just as it is > removed from leadership, you can still get bogus data, with no indication > anything went wrong. Some people are reporting that this breaks tools that > generate HTTP proxy configurations. > > > > I filed this issue a while ago as > https://issues.apache.org/jira/browse/MESOS-1865 > > > > On Aug 4, 2015, at 3:49 PM, Vinod Kone <[email protected]> wrote: > > > > > Not today, no. > > > > > > But, you could either hit the "/redirect" endpoint on any master that > should redirect you to the leading master. > > > > > > On Tue, Aug 4, 2015 at 3:29 PM, Nastooh Avessta (navesta) < > [email protected]> wrote: > > > I see. Nope, and pointing to the leading master shows the proper > resultJ Thanks. > > > > > > Is there a REST equivalent to mesos-resolve, so that one can ascertain > who is the leader without having to point to the leader? > > > > > > Cheers, > > > > > > > > > > > > <image001.jpg> > > > > > > Nastooh Avessta > > > ENGINEER.SOFTWARE ENGINEERING > > > [email protected] > > > Phone: +1 604 647 1527 > > > > > > Cisco Systems Limited > > > 595 Burrard Street, Suite 2123 Three Bentall Centre, PO Box 49121 > > > VANCOUVER > > > BRITISH COLUMBIA > > > V7X 1J1 > > > CA > > > Cisco.com > > > > > > > > > > > > <image002.gif>Think before you print. > > > > > > This email may contain confidential and privileged material for the > sole use of the intended recipient. Any review, use, distribution or > disclosure by others is strictly prohibited. If you are not the intended > recipient (or authorized to receive for the recipient), please contact the > sender by reply email and delete all copies of this message. > > > > > > For corporate legal information go to: > > > http://www.cisco.com/web/about/doing_business/legal/cri/index.html > > > > > > Cisco Systems Canada Co, 181 Bay St., Suite 3400, Toronto, ON, Canada, > M5J 2T3. Phone: 416-306-7000; Fax: 416-306-7099. Preferences - > Unsubscribe – Privacy > > > > > > > > > > > > From: Vinod Kone [mailto:[email protected]] > > > Sent: Tuesday, August 04, 2015 3:19 PM > > > To: [email protected] > > > Subject: Re: Get List of Active Slaves > > > > > > > > > > > > Is that the leading master? > > > > > > > > > > > > On Tue, Aug 4, 2015 at 3:09 PM, Nastooh Avessta (navesta) < > [email protected]> wrote: > > > > > > Hi > > > > > > Trying to get the list of active slaves, via cli, e.g. curl > http://10.4.50.80:5050/master/slaves | python -m json.tool and am not > getting the expected results. The returned value is empty: > > > > > > { > > > > > > "slaves": [] > > > > > > } > > > > > > , whereas, looking at web gui I can see that there are deployed > slaves. Am I missing something? > > > > > > Cheers, > > > > > > > > > > > > <image001.jpg> > > > > > > Nastooh Avessta > > > ENGINEER.SOFTWARE ENGINEERING > > > [email protected] > > > Phone: +1 604 647 1527 > > > > > > Cisco Systems Limited > > > 595 Burrard Street, Suite 2123 Three Bentall Centre, PO Box 49121 > > > VANCOUVER > > > BRITISH COLUMBIA > > > V7X 1J1 > > > CA > > > Cisco.com > > > > > > > > > > > > <image002.gif>Think before you print. > > > > > > This email may contain confidential and privileged material for the > sole use of the intended recipient. Any review, use, distribution or > disclosure by others is strictly prohibited. If you are not the intended > recipient (or authorized to receive for the recipient), please contact the > sender by reply email and delete all copies of this message. > > > > > > For corporate legal information go to: > > > http://www.cisco.com/web/about/doing_business/legal/cri/index.html > > > > > > Cisco Systems Canada Co, 181 Bay St., Suite 3400, Toronto, ON, Canada, > M5J 2T3. Phone: 416-306-7000; Fax: 416-306-7099. Preferences - > Unsubscribe – Privacy > > > > > > > > > > > > > > > > > > > > > >

