2
votes

I am trying to write a little automated status routine for my cluster. Basically, I am writing a little shell script that will query all the nodes, checking for various metrics (kind of like Ganglia would give me.. but I can't use that... long story). This done, other than for HBase. For all other servers (NN, JT, ZKs, etc.) I can look in configuration files and know the hostname. The HBase master, however, is not listed anywhere. It is in the '/hbase/master' znode.

My question.. how can I get that hostname just from bash? I have been trying things like 'zkCli.sh -server myzoo << get /hbase/master', and similar, but so far, I am coming up empty.

Bottom line, is that I want one shell script that can access all of my main servers. HBase is the only one I am having trouble with.

Thanks, in advance.

2
good addition.. thanks Jayan K.Wanderer
what is the problem with zkCli.sh -server myzoo << get /hbase/mastersbridges
the zkCli.sh -server myzoo << get /hbase/master does not really seem to do anything. Puts me at a '>' prompt... but does not give me any thing helpful.Wanderer
so, I was able to get closer by putting my commands in a text file and running zkCli.sh -server myzoo < input.txt. The input file (input.txt) has two lines. The first line performs a get (get /hbase/master) and the second line does a quit. While this works, it is still not optimal. Any other ideas?Wanderer

2 Answers

2
votes

According to the usage string, we should be able to just do

zkCli.sh -server myzoo get /hbase/master

Even if that doesn't work, we can do without input.txt:

zkCli.sh -server myzoo <<EOF
get /hbase/master
quit
EOF
0
votes

we can have "hbase.master" property in hbase-site.xml file, and from there you can pick it just like other processes.