Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 06-17-2016 01:35 PM
Hi,
I want to get the current active HBaseMaster from Zookeeper under znode /hbase-secure/master via zkCli.sh commandline call.
The output is almost fine, but the nodename is somehow screwed up, so that I cannot use it for comparisons later on =>
#>/usr/hdp/current/zookeeper-client/bin/zkCli.sh -server 01876.something.corp,01874.something.corp,02878.something.corp get /hbase-secure/master Connecting to 01876.something.corp,01874.something.corp,02878.something.corp WATCHER:: WatchedEvent state:SyncConnected type:None path:null WATCHER:: WatchedEvent state:SaslAuthenticated type:None path:null �master:16000��O�;��PBUF ' 2878.something.corp�}�����*�} cZxid = 0x6a00019c8a ctime = Fri Jun 17 14:59:21 CEST 2016 mZxid = 0x6a00019c8a mtime = Fri Jun 17 14:59:21 CEST 2016 pZxid = 0x6a00019c8a cversion = 0 dataVersion = 0 aclVersion = 0 ephemeralOwner = 0x1555727df0a001c dataLength = 75 numChildren = 0
Any hint how to get the correct nodename of the current active HBase Master via commandline ?!?!
Thanks, Gerd
=============
HDP 2.3.4.7, HBase HA , kerberized
Created 06-17-2016 05:45 PM
In newer versions of the HBase, you can use
status 'detailed'
which will print the active master, backup masters as well as regionservers.
Created 06-17-2016 02:14 PM
Hi Gerd,
You found the right ZNode used for having one and only one active HBase master at one time. The reason it's "screwed" up is that you're actually seeing a serialized data structure. The contents of that znode is a serialized instance of the org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.Master protocol buffer class.
I'm not seeing anything in the HBase shell yet which would be helpful.
Created 06-17-2016 06:47 PM
Many thanks for the xplanation @Josh Elser
I'll use status 'detailed' + some grep'ing around as mentioned by @Enis
Created 06-17-2016 02:39 PM
Actually, looks like we might bundle a script you can call for this:
/usr/hdp/current/hbase-client/bin/hbase-jruby /usr/hdp/current/hbase-client/bin/get-active-master.rb
Not sure what the availability of this script is across older versions of HDP.
Created 06-17-2016 05:45 PM
In newer versions of the HBase, you can use
status 'detailed'
which will print the active master, backup masters as well as regionservers.
Created 06-17-2016 06:50 PM
Hi @Enis,
thanks for this hint. I'll use that in a way like
echo "status 'detailed'" >hbase.command echo "exit" >> hbase.command hbase shell -n hbase.command => and then further process the output with bash builtins
Thanks, Gerd