The Hortonworks Community Connection is now live. A completely rebuilt Q&A forum, Knowledge Base, Code Hub and more, backed by the experts in the industry.

You will be redirected here in 10 seconds. If your are not redirected, click here to visit the new site.

The legacy Hortonworks Forum is now closed. You can view a read-only version of the former site by clicking here. The site will be taken offline on January 31,2016

HBase Forum

Unable to Connect to Remote Server using Hbase

  • #8566
    Navya Marina
    Member

    I am very new to Hbase and Hadoop. I want to create a table in Java and communicate with my Remote Server. But it throwing me an error, I am confused with Configuration details in habse-site .xml
    java Code:
    import java.io.IOException;

    import org.apache.hadoop.conf.Configuration;
    import org.apache.hadoop.hbase.HBaseConfiguration;
    import org.apache.hadoop.hbase.client.Get;
    import org.apache.hadoop.hbase.client.HTable;
    import org.apache.hadoop.hbase.client.Put;
    import org.apache.hadoop.hbase.client.Result;
    import org.apache.hadoop.hbase.client.ResultScanner;
    import org.apache.hadoop.hbase.client.Scan;
    import org.apache.hadoop.hbase.util.Bytes;

    public class HBaseConnector {
    public static void main(String[] args) throws IOException {

    Configuration config = HBaseConfiguration.create();
    HTable table = new HTable(config, “myLittleHBaseTable”);
    Put p = new Put(Bytes.toBytes(“myLittleRow”));
    p.add(Bytes.toBytes(“myLittleFamily”), Bytes.toBytes(“someQualifier”),
    Bytes.toBytes(“Some Value”));
    table.put(p);

    Get g = new Get(Bytes.toBytes(“myLittleRow”));
    Result r = table.get(g);
    byte[] value = r.getValue(Bytes.toBytes(“myLittleFamily”), Bytes.toBytes(“someQualifier”));
    String valueStr = Bytes.toString(value);
    System.out.println(“GET: ” + valueStr);

    Scan s = new Scan();
    s.addColumn(Bytes.toBytes(“myLittleFamily”), Bytes
    .toBytes(“someQualifier”));
    ResultScanner scanner = table.getScanner(s);
    try {
    for (Result rr = scanner.next(); rr != null; rr = scanner.next()) {
    System.out.println(“Found row: ” + rr);
    }

    // The other approach is to use a foreach loop. Scanners are
    // iterable!
    // for (Result rr : scanner) {
    // System.out.println(“Found row: ” + rr);
    // }
    }
    finally
    {
    scanner.close();
    }
    }
    }

    Hbase-site.xml:

    hbase.rootdir
    hdfs://172.16.17.55:60000/hbase

    hbase.master
    172.16.17.55:60000

    hbase.cluster.distributed
    true

    hbase.zookeeper.quorum
    172.16.17.55

    hbase.zookeeper.property.clientPort
    60000

    Error:
    12/08/22 17:37:25 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version=3.3.5-1301095, built on 03/15/2012 19:48 GMT
    12/08/22 17:37:25 INFO zookeeper.ZooKeeper: Client environment:host.name=user-8329a7141c
    12/08/22 17:37:25 INFO zookeeper.ZooKeeper: Client environment:java.version=1.6.0_25
    12/08/22 17:37:25 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Sun Microsystems Inc.
    12/08/22 17:37:25 INFO zookeeper.ZooKeeper: Client environment:java.home=C:\Program Files\Java\jre6
    12/08/22 17:37:25 INFO zookeeper.ZooKeeper: Client environment:java.class.path=D:\workspace\Hbase\bin;C:\Documents and Settings\user\Desktop\HAdoop\jars\commons-cli-1.2.jar;C:\Documents and Settings\user\Desktop\HAdoop\jars\commons-logging-1.1.1.jar;C:\Documents and Settings\user\Desktop\HAdoop\jars\log4j-1.2.16.jar;C:\Documents and Settings\user\Desktop\HAdoop\jars\lib\hbase-dsl-0.1.2-SNAPSHOT.jar;C:\Documents and Settings\user\Desktop\HAdoop\jars\lib\commons-lang-2.5.jar;C:\Documents and Settings\user\Desktop\HAdoop\jars\lib\commons-logging-api-1.1.jar;C:\Documents and Settings\user\Desktop\HAdoop\jars\lib\hadoop-core-0.20.2.jar;C:\Documents and Settings\user\My Documents\Downloads\slf4j-1.6.6\slf4j-api-1.6.6.jar;C:\Documents and Settings\user\My Documents\Downloads\slf4j-1.6.6\slf4j-log4j12-1.6.6.jar;C:\Documents and Settings\user\Desktop\HAdoop\jars\lib\hbase-0.92.1.jar;C:\Documents and Settings\user\Desktop\HAdoop\jars\lib\zookeeper-3.3.5.jar;C:\Documents and Settings\user\Desktop\HAdoop\jars\lib\hbase-0.90.6.jar
    12/08/22 17:37:25 INFO zookeeper.ZooKeeper: Client environment:java.library.path=C:\Program Files\Java\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:\WINDOWS\system32;D:\oracle\product\10.2.0\db_1\bin;C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\servlet-api.jar;D:\Pervasive Stuff\New Training stuff\datarush-6.0.0-26\bin;C:\Program Files\Java\jdk1.6.0_25\bin;C:\Program Files\grails-2.0.4\bin;.;
    12/08/22 17:37:25 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=C:\DOCUME~1\user\LOCALS~1\Temp\
    12/08/22 17:37:25 INFO zookeeper.ZooKeeper: Client environment:java.compiler=
    12/08/22 17:37:25 INFO zookeeper.ZooKeeper: Client environment:os.name=Windows XP
    12/08/22 17:37:25 INFO zookeeper.ZooKeeper: Client environment:os.arch=x86
    12/08/22 17:37:25 INFO zookeeper.ZooKeeper: Client environment:os.version=5.1
    12/08/22 17:37:25 INFO zookeeper.ZooKeeper: Client environment:user.name=user
    12/08/22 17:37:25 INFO zookeeper.ZooKeeper: Client environment:user.home=C:\Documents and Settings\user
    12/08/22 17:37:25 INFO zookeeper.ZooKeeper: Client environment:user.dir=D:\workspace\Hbase
    12/08/22 17:37:25 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
    12/08/22 17:37:25 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
    12/08/22 17:37:25 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 3484@user-8329a7141c
    12/08/22 17:37:26 WARN zookeeper.ClientCnxn: Session 0×0 for server null, unexpected error, closing socket connection and attempting reconnect
    java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
    12/08/22 17:37:26 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
    12/08/22 17:37:26 INFO util.RetryCounter: The 1 times to retry after sleeping 2000 ms
    12/08/22 17:37:28 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
    12/08/22 17:37:29 WARN zookeeper.ClientCnxn: Session 0×0 for server null, unexpected error, closing socket connection and attempting reconnect
    java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
    12/08/22 17:37:29 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
    12/08/22 17:37:29 INFO util.RetryCounter: The 2 times to retry after sleeping 4000 ms
    12/08/22 17:37:31 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
    12/08/22 17:37:32 WARN zookeeper.ClientCnxn: Session 0×0 for server null, unexpected error, closing socket connection and attempting reconnect
    java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
    12/08/22 17:37:34 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
    12/08/22 17:37:34 WARN zookeeper.ClientCnxn: Session 0×0 for server null, unexpected error, closing socket connection and attempting reconnect
    java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
    12/08/22 17:37:35 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
    12/08/22 17:37:35 INFO util.RetryCounter: The 3 times to retry after sleeping 8000 ms
    12/08/22 17:37:36 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
    12/08/22 17:37:37 WARN zookeeper.ClientCnxn: Session 0×0 for server null, unexpected error, closing socket connection and attempting reconnect
    java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
    12/08/22 17:37:38 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
    12/08/22 17:37:39 WARN zookeeper.ClientCnxn: Session 0×0 for server null, unexpected error, closing socket connection and attempting reconnect
    java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
    12/08/22 17:37:41 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
    12/08/22 17:37:42 WARN zookeeper.ClientCnxn: Session 0×0 for server null, unexpected error, closing socket connection and attempting reconnect
    java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
    12/08/22 17:37:44 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
    12/08/22 17:37:45 WARN zookeeper.ClientCnxn: Session 0×0 for server null, unexpected error, closing socket connection and attempting reconnect
    java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
    12/08/22 17:37:45 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
    12/08/22 17:37:45 ERROR zookeeper.RecoverableZooKeeper: ZooKeeper exists failed after 3 retries
    12/08/22 17:37:45 WARN zookeeper.ZKUtil: hconnection Unable to set watcher on znode /hbase/master
    org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:815)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:154)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.watchAndCheckExists(ZKUtil.java:226)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker.start(ZooKeeperNodeTracker.java:76)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.setupZookeeperTrackers(HConnectionManager.java:580)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.(HConnectionManager.java:569)
    at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:186)
    at org.apache.hadoop.hbase.client.HTable.(HTable.java:194)
    at org.apache.hadoop.hbase.client.HTable.(HTable.java:171)
    at com.strat.HBaseConnector.main(HBaseConnector.java:18)
    12/08/22 17:37:45 ERROR zookeeper.ZooKeeperWatcher: hconnection Received unexpected KeeperException, re-throwing exception
    org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:815)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:154)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.watchAndCheckExists(ZKUtil.java:226)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker.start(ZooKeeperNodeTracker.java:76)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.setupZookeeperTrackers(HConnectionManager.java:580)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.(HConnectionManager.java:569)
    at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:186)
    at org.apache.hadoop.hbase.client.HTable.(HTable.java:194)
    at org.apache.hadoop.hbase.client.HTable.(HTable.java:171)
    at com.strat.HBaseConnector.main(HBaseConnector.java:18)
    12/08/22 17:37:45 FATAL client.HConnectionManager$HConnectionImplementation: Unexpected exception during initialization, aborting
    org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:815)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:154)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.watchAndCheckExists(ZKUtil.java:226)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker.start(ZooKeeperNodeTracker.java:76)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.setupZookeeperTrackers(HConnectionManager.java:580)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.(HConnectionManager.java:569)
    at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:186)
    at org.apache.hadoop.hbase.client.HTable.(HTable.java:194)
    at org.apache.hadoop.hbase.client.HTable.(HTable.java:171)
    at com.strat.HBaseConnector.main(HBaseConnector.java:18)
    12/08/22 17:37:46 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
    12/08/22 17:37:47 WARN zookeeper.ClientCnxn: Session 0×0 for server null, unexpected error, closing socket connection and attempting reconnect
    java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
    12/08/22 17:37:47 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/root-region-server
    12/08/22 17:37:47 INFO util.RetryCounter: The 1 times to retry after sleeping 2000 ms
    12/08/22 17:37:49 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
    12/08/22 17:37:50 WARN zookeeper.ClientCnxn: Session 0×0 for server null, unexpected error, closing socket connection and attempting reconnect
    java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
    12/08/22 17:37:50 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/root-region-server
    12/08/22 17:37:50 INFO util.RetryCounter: The 2 times to retry after sleeping 4000 ms
    12/08/22 17:37:51 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
    12/08/22 17:37:52 WARN zookeeper.ClientCnxn: Session 0×0 for server null, unexpected error, closing socket connection and attempting reconnect
    java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
    12/08/22 17:37:53 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
    12/08/22 17:37:54 WARN zookeeper.ClientCnxn: Session 0×0 for server null, unexpected error, closing socket connection and attempting reconnect
    java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
    12/08/22 17:37:54 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/root-region-server
    12/08/22 17:37:54 INFO util.RetryCounter: The 3 times to retry after sleeping 8000 ms
    12/08/22 17:37:56 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
    12/08/22 17:37:56 WARN zookeeper.ClientCnxn: Session 0×0 for server null, unexpected error, closing socket connection and attempting reconnect
    java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
    12/08/22 17:37:58 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
    12/08/22 17:37:59 WARN zookeeper.ClientCnxn: Session 0×0 for server null, unexpected error, closing socket connection and attempting reconnect
    java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
    12/08/22 17:38:00 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
    12/08/22 17:38:01 WARN zookeeper.ClientCnxn: Session 0×0 for server null, unexpected error, closing socket connection and attempting reconnect
    java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
    12/08/22 17:38:03 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
    12/08/22 17:38:04 WARN zookeeper.ClientCnxn: Session 0×0 for server null, unexpected error, closing socket connection and attempting reconnect
    java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1143)
    12/08/22 17:38:04 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/root-region-server
    12/08/22 17:38:04 ERROR zookeeper.RecoverableZooKeeper: ZooKeeper exists failed after 3 retries
    12/08/22 17:38:04 WARN zookeeper.ZKUtil: hconnection Unable to set watcher on znode /hbase/root-region-server
    org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/root-region-server
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:815)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:154)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.watchAndCheckExists(ZKUtil.java:226)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker.start(ZooKeeperNodeTracker.java:76)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.setupZookeeperTrackers(HConnectionManager.java:583)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.(HConnectionManager.java:569)
    at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:186)
    at org.apache.hadoop.hbase.client.HTable.(HTable.java:194)
    at org.apache.hadoop.hbase.client.HTable.(HTable.java:171)
    at com.strat.HBaseConnector.main(HBaseConnector.java:18)
    12/08/22 17:38:04 ERROR zookeeper.ZooKeeperWatcher: hconnection Received unexpected KeeperException, re-throwing exception
    org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/root-region-server
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:815)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:154)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.watchAndCheckExists(ZKUtil.java:226)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker.start(ZooKeeperNodeTracker.java:76)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.setupZookeeperTrackers(HConnectionManager.java:583)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.(HConnectionManager.java:569)
    at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:186)
    at org.apache.hadoop.hbase.client.HTable.(HTable.java:194)
    at org.apache.hadoop.hbase.client.HTable.(HTable.java:171)
    at com.strat.HBaseConnector.main(HBaseConnector.java:18)
    12/08/22 17:38:04 FATAL client.HConnectionManager$HConnectionImplementation: Unexpected exception during initialization, aborting
    org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/root-region-server
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:42)
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:815)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:154)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.watchAndCheckExists(ZKUtil.java:226)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperNodeTracker.start(ZooKeeperNodeTracker.java:76)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.setupZookeeperTrackers(HConnectionManager.java:583)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.(HConnectionManager.java:569)
    at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:186)
    at org.apache.hadoop.hbase.client.HTable.(HTable.java:194)
    at org.apache.hadoop.hbase.client.HTable.(HTable.java:171)
    at com.strat.HBaseConnector.main(HBaseConnector.java:18)
    Exception in thread “main” java.io.IOException: org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation@19209ea closed
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:794)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:782)
    at org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:249)
    at org.apache.hadoop.hbase.client.HTable.(HTable.java:213)
    at org.apache.hadoop.hbase.client.HTable.(HTable.java:171)
    at com.strat.HBaseConnector.main(HBaseConnector.java:18)

  • Author
    Replies
  • #8631
    Sasha J
    Moderator

    Navya,
    It seems like your HBase installation trying to communicate with ZooKepper over the localhost IP on default port 2181:

    12/08/22 17:37:31 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181

    And your hbase-site.xml points to oyther IP and other port:
    hbase.zookeeper.quorum
    172.16.17.55

    hbase.zookeeper.property.clientPort
    60000

    Please, make sure, that your ZK bound to the correct address and to correct port and adjust your configuration.
    In general, ZK should not bound to “localhost”, this way it can not communicate with the external processes…

    Thank you!
    Sasha

    #77368
    Edgar Daos
    Participant

    Hi Sasha,
    Do you know how to change the configuration that HBase connects Zookeeper? I am facing the same problem and I dont know where can I change it.
    Thanks!

    #81839
    Alaa Yagoub
    Participant

    I have same issue with phoenix and Hbase to access them remotely.  I am trying to do the following steps to access to Apache Phoenix

    Step 1:To Access Phoenix in HDP virtual machine , I used

    > ./sqlline.py localhost:2181:/hbase-unsecure

    It worked fine.

    Step 2: I tried to run the following code in the virtual machine:
    file: test.java

    import java.sql.*;
    import java.util.*;

    public class test {
    public static void main(String args[]) throws Exception {
    Connection conn;
    Properties prop = new Properties();
    Class.forName(“org.apache.phoenix.jdbc.PhoenixDriver”);
    conn =  DriverManager.getConnection(“jdbc:phoenix:127.0.0.1:2181:/hbase-unsecure”);
    System.out.println(“got connection”);
    }
    }
    I used the following steps:

    1. cd /usr/hdp/2.3.0.0-2557/phoenix
    2. javac test.java
    3. java -cp “phoenix-4.4.0.2.3.0.0-2557-client.jar:.” test

    It worked fine.

    Step3: I tried to connect remotely through Squirrel version 3.7. I used URL:  jdbc:phoenix:127.0.0.1:2181:/hbase-unsecure
    When I created the connection, It’s hanging

    Step4: I tried to use same code to access from my machine to Virtual HDP and It’s hanging also.

    I tried to turn off any firewall in the virtual machine and my machine to avoid any blocking. I checked the port 2181 in the Ambari and this port is fine. Also I checked the port 2181 in the virtual machine by using nestat and it’s fine. Also I tried to use CurrPorts  application to check about port 2181 and I did not find it. I am using HDP 2.3. I think the problem in the virtual machine.

    I don’t know why the remote connection did not work for HDP. If you have any concern let me know about my steps to make the remote access worked fine.

     

The forum ‘HBase’ is closed to new topics and replies.

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.