Last active
September 25, 2015 02:32
-
-
Save ashwanthkumar/3624a4e69ab26236a746 to your computer and use it in GitHub Desktop.
Useful to find the missing host, when you've 100s of machines on AWS running TT and DN process and their dns names are autogenerated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This assumes that jq is installed on your machine | |
JT_MACHINE="jt-host" | |
NN_MACHINE="nn-host" | |
# Get all the TTs | |
curl "http://${JT_MACHINE}:50030/jmx?qry=hadoop:service=JobTracker,name=JobTrackerInfo" | jq -r .beans[].AliveNodesInfoJson | jq -r .[].hostname | sort > tasktrackers | |
# Get all the DNs | |
curl "http://${NN_MACHINE}:50070/jmx?qry=Hadoop:service=NameNode,name=NameNodeInfo" | jq -r .beans[].LiveNodes | jq -r 'keys | .[]' | sort > datanodes | |
diff tasktrackers datanodes | egrep "<|>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment