Reputation: 1647
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.
Upvotes: 2
Views: 3091
Reputation: 19375
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
Upvotes: 2
Reputation: 34184
we can have "hbase.master" property in hbase-site.xml file, and from there you can pick it just like other processes.
Upvotes: 0