Skip to content

Instantly share code, notes, and snippets.

@rasputnik
Created September 23, 2014 15:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rasputnik/98aac2f8230a26f06e64 to your computer and use it in GitHub Desktop.
Save rasputnik/98aac2f8230a26f06e64 to your computer and use it in GitHub Desktop.
find marathon master using zk CLI tool
Although marathon nodes proxy to the master, that will only happen if they're alive to proxy :)
We've worked around this by using https://github.com/mmcgrana/zk to find the current marathon master from zookeeper and make the request to that. Something like:
export ZOOKEEPER_SERVERS=zk://.......
export MARATHON_ZNODE=/marathon
export LEADER=$MARATHON_ZNODE/leader
# find marathon master (each active master shows here, just grab the last)
MNODE=`zk children $MLEADER| head -1`
MMASTER=`zk get $MLEADER/$MNODE`
# ... make request to MMASTER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment