How to check Zookeeper connection in HBase? -
i want quick connection check zookeeper after creating configurations , before establishing connection hbase master java code. hbase api method checking zookeeper connection status in cluster?
try following code
configuration config = hbaseconfiguration.create(); config.set("hbase.zookeeper.quorum", "hbase"); config.set("hbase.zookeeper.property.clientport","2181");
after configured connection, can test it, using
hbaseadmin.checkhbaseavailable(config);
it test connection database, if zookeeper doesn't work error printed saying there problem zookeeper.
Comments
Post a Comment