HBase Forum

Problem simple with Java client from OSX – HDP 2 Sandbox under VBox

  • #43898

    I am trying to get a simple Java client application running to test a HDP 2.0 Sandbox on OSX.

    I am invoking the following client under OSX to test with command line args: horton, 2181

    public class TestHortonSandbox {
    public static void main(String[] args) throws IOException {
    Configuration config = HBaseConfiguration.create();
    config.set(“hbase.zookeeper.quorum”, args[0]);
    config.set(“hbase.zookeeper.property.clientPort”, args[1]);
    try {
    } catch (MasterNotRunningException e) {
    System.out.println(“HBase is not running.”);
    } catch (ServiceException e) {
    System.out.println(“Service Exception”);
    System.out.println(“*** Things look healthy ***”);

    I am receiving the following error:

    2013-11-17 06:55:28,952 INFO [main] zookeeper.ZooKeeper (ZooKeeper.java:(438)) – Initiating client connection, connectString= sessionTimeout=90000 watcher=hconnection-0x5f8fb0ca
    2013-11-17 06:55:28,967 INFO [main] zookeeper.RecoverableZooKeeper (RecoverableZooKeeper.java:(120)) – Process identifier=hconnection-0x5f8fb0ca connecting to ZooKeeper ensemble=
    2013-11-17 06:55:29,002 INFO [main-SendThread(horton:2181)] zookeeper.ClientCnxn (ClientCnxn.java:logStartConnect(966)) – Opening socket connection to server horton/ Will not attempt to authenticate using SASL (unknown error)
    2013-11-17 06:55:29,007 INFO [main-SendThread(horton:2181)] zookeeper.ClientCnxn (ClientCnxn.java:primeConnection(849)) – Socket connection established to horton/, initiating session
    2013-11-17 06:55:29,014 INFO [main-SendThread(horton:2181)] zookeeper.ClientCnxn (ClientCnxn.java:onConnected(1211)) – Session establishment complete on server horton/, sessionid = 0x14265e8aa4f0007, negotiated timeout = 40000
    2013-11-17 06:55:29,018 INFO [main] client.ZooKeeperRegistry (ZooKeeperRegistry.java:getClusterId(85)) – ClusterId read in ZooKeeper is null
    2013-11-17 06:55:29,058 INFO [main] client.HConnectionManager$HConnectionImplementation (HConnectionManager.java:makeStub(1602)) – getMaster attempt 1 of 1 failed; no more retrying.
    java.io.IOException: Can’t get master address from ZooKeeper; znode data == null

to create new topics or reply. | New User Registration

  • Author
  • #43902
    Peter Rudenko

    1. You need to start HBase (it’s disabled by default on Sandbox). You can do it either from hue about page ( or from ambari.
    2. You need to make dns alias in /etc/hosts to :
    3. Whether copy /etc/hbase/conf/hbase-site.xml from sandbox to your classpath or add one more setting to your code:

    config.set("zookeeper.znode.parent", "/hbase-unsecure");

    Enis Soztutar

    Hi Kieran,

    As Peter points out, you should also set the zookeeper.znode.parent property to “/hbase-unsercure”. However, the recommended practice for hbase clients is to not set the config properties, but add hbase conf dir (/etc/hbase/conf/) to classpath, and let HBaseConfiguration take care reading the necessary configuration. You can also copy the conf files from /etc/hbase/conf to your classpath as well.


    Enis / Peter,

    I was able to get to Hue via and was able to run Hbase shell commands…so Hbase appears up and healthy

    Went back to my java program (with the added config.set(“zookeeper.znode.parent”, “/hbase-unsecure”) in lieu of the classpath change…

    I added the line qualified name sandbox.hortonworks.com (rather than simply sandbox) to the /etc/hosts on the OSX and that did it!

    Thanks much.

You must be to reply to this topic. | Create Account

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.