Skip to content

Instantly share code, notes, and snippets.

@drewr
Created November 20, 2012 15:09
Show Gist options
  • Save drewr/4118487 to your computer and use it in GitHub Desktop.
Save drewr/4118487 to your computer and use it in GitHub Desktop.
Check master on each node
IF=wlan0
ESPORT=9200
echo -n me: $(sudo ifconfig $IF | sed "s,.*inet addr:\([^ ]*\).*,\1,;tx;d;:x") "master: "
curl -s localhost:${ESPORT}/_cluster/state | \
jsawk -n 'out(this.master_node,
this.nodes[this.master_node].name,
this.nodes[this.master_node].transport_address)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment