Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Cannot reach HBase installed on HDP sandbox from a java client on the host

Highlighted

Cannot reach HBase installed on HDP sandbox from a java client on the host

Rising Star

I have HDP 2.5 sandbox running in Virtualbox VM.

My host is Windows 8 based, and I'm developping a java application that has to connect to HBase. If I run this application on the sandbox linux server, it works perfectly, but if I run it from my host, I cannot make it successfull.

I read several posts on this topic, and finally remove all the conf.set(...) instructions from my code, but copied the whole content from "/etc/hbase/conf" folder in my application classpath.

When I execute the application, see below is an extract of the logs in my java console.

I took a look at /etc/hosts file on the sandbox linux server, here it is :

127.0.0.1       localhost
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.2      sandbox.hortonworks.com

And here is the content of C:/Windows/System32/drivers/etc/host file on my host :

...
127.0.0.1      sandbox.hortonworks.com localhost
...

(I also tried out to replace 127.0.0.1 by 172.17.0.2 in this file but it failed to execute too)

Does anyone has an idea about something wrong in my configuration ?

Thanks a lot for your help.

Sebastien

....
2016-11-20 21:10:04 DEBUG UserGroupInformation:195 - hadoop login
2016-11-20 21:10:04 DEBUG UserGroupInformation:144 - hadoop login commit
2016-11-20 21:10:04 DEBUG UserGroupInformation:174 - using local user:NTUserPrincipal : sebastien
2016-11-20 21:10:04 DEBUG UserGroupInformation:785 - UGI loginUser:sebastien (auth:SIMPLE)
2016-11-20 21:10:04 INFO  RecoverableZooKeeper:120 - Process identifier=hconnection-0x3224f60b connecting to ZooKeeper ensemble=sandbox.hortonworks.com:2181
2016-11-20 21:10:13 INFO  ZooKeeper:100 - Client environment:zookeeper.version=3.4.6-1569965, built on 02/20/2014 09:09 GMT
2016-11-20 21:10:13 INFO  ZooKeeper:100 - Client environment:host.name=PC-Softera
2016-11-20 21:10:13 INFO  ZooKeeper:100 - Client environment:java.version=1.8.0_102
2016-11-20 21:10:13 INFO  ZooKeeper:100 - Client environment:java.vendor=Oracle Corporation
2016-11-20 21:10:13 INFO  ZooKeeper:100 - Client environment:java.home=C:\Program Files\Java\jdk1.8.0_102\jre
2016-11-20 21:10:13 INFO  ZooKeeper:100 - Client environment:java.class.path=C:\Seb\DataLab\Dev\workspace\tuto1\target\classes;C:\Users\sebastien\.m2\repository\org\apache\hbase\hbase-client\1.1.2\hbase-client-1.1.2.jar;C:\Users\sebastien\.m2\repository\org\apache\hbase\hbase-annotations\1.1.2\hbase-annotations-1.1.2.jar;C:\Users\sebastien\.m2\repository\org\apache\hbase\hbase-common\1.1.2\hbase-common-1.1.2.jar;C:\Users\sebastien\.m2\repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;C:\Users\sebastien\.m2\repository\org\mortbay\jetty\jetty-util\6.1.26\jetty-util-6.1.26.jar;C:\Users\sebastien\.m2\repository\org\apache\hbase\hbase-protocol\1.1.2\hbase-protocol-1.1.2.jar;C:\Users\sebastien\.m2\repository\commons-codec\commons-codec\1.9\commons-codec-1.9.jar;C:\Users\sebastien\.m2\repository\commons-io\commons-io\2.4\commons-io-2.4.jar;C:\Users\sebastien\.m2\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;C:\Users\sebastien\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;C:\Users\sebastien\.m2\repository\com\google\guava\guava\12.0.1\guava-12.0.1.jar;C:\Users\sebastien\.m2\repository\com\google\code\findbugs\jsr305\1.3.9\jsr305-1.3.9.jar;C:\Users\sebastien\.m2\repository\com\google\protobuf\protobuf-java\2.5.0\protobuf-java-2.5.0.jar;C:\Users\sebastien\.m2\repository\io\netty\netty-all\4.0.23.Final\netty-all-4.0.23.Final.jar;C:\Users\sebastien\.m2\repository\org\apache\zookeeper\zookeeper\3.4.6\zookeeper-3.4.6.jar;C:\Users\sebastien\.m2\repository\org\slf4j\slf4j-api\1.6.1\slf4j-api-1.6.1.jar;C:\Users\sebastien\.m2\repository\org\slf4j\slf4j-log4j12\1.6.1\slf4j-log4j12-1.6.1.jar;C:\Users\sebastien\.m2\repository\org\apache\htrace\htrace-core\3.1.0-incubating\htrace-core-3.1.0-incubating.jar;C:\Users\sebastien\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.13\jackson-mapper-asl-1.9.13.jar;C:\Users\sebastien\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.13\jackson-core-asl-1.9.13.jar;C:\Users\sebastien\.m2\repository\org\jruby\jcodings\jcodings\1.0.8\jcodings-1.0.8.jar;C:\Users\sebastien\.m2\repository\org\jruby\joni\joni\2.1.2\joni-2.1.2.jar;C:\Users\sebastien\.m2\repository\org\apache\hadoop\hadoop-auth\2.5.1\hadoop-auth-2.5.1.jar;C:\Users\sebastien\.m2\repository\org\apache\httpcomponents\httpclient\4.2.5\httpclient-4.2.5.jar;C:\Users\sebastien\.m2\repository\org\apache\httpcomponents\httpcore\4.2.4\httpcore-4.2.4.jar;C:\Users\sebastien\.m2\repository\org\apache\directory\server\apacheds-kerberos-codec\2.0.0-M15\apacheds-kerberos-codec-2.0.0-M15.jar;C:\Users\sebastien\.m2\repository\org\apache\directory\server\apacheds-i18n\2.0.0-M15\apacheds-i18n-2.0.0-M15.jar;C:\Users\sebastien\.m2\repository\org\apache\directory\api\api-asn1-api\1.0.0-M20\api-asn1-api-1.0.0-M20.jar;C:\Users\sebastien\.m2\repository\org\apache\directory\api\api-util\1.0.0-M20\api-util-1.0.0-M20.jar;C:\Users\sebastien\.m2\repository\org\apache\hadoop\hadoop-common\2.5.1\hadoop-common-2.5.1.jar;C:\Users\sebastien\.m2\repository\org\apache\hadoop\hadoop-annotations\2.5.1\hadoop-annotations-2.5.1.jar;C:\Users\sebastien\.m2\repository\commons-cli\commons-cli\1.2\commons-cli-1.2.jar;C:\Users\sebastien\.m2\repository\org\apache\commons\commons-math3\3.1.1\commons-math3-3.1.1.jar;C:\Users\sebastien\.m2\repository\xmlenc\xmlenc\0.52\xmlenc-0.52.jar;C:\Users\sebastien\.m2\repository\commons-httpclient\commons-httpclient\3.1\commons-httpclient-3.1.jar;C:\Users\sebastien\.m2\repository\commons-net\commons-net\3.1\commons-net-3.1.jar;C:\Users\sebastien\.m2\repository\commons-el\commons-el\1.0\commons-el-1.0.jar;C:\Users\sebastien\.m2\repository\commons-configuration\commons-configuration\1.6\commons-configuration-1.6.jar;C:\Users\sebastien\.m2\repository\commons-digester\commons-digester\1.8\commons-digester-1.8.jar;C:\Users\sebastien\.m2\repository\commons-beanutils\commons-beanutils\1.7.0\commons-beanutils-1.7.0.jar;C:\Users\sebastien\.m2\repository\commons-beanutils\commons-beanutils-core\1.8.0\commons-beanutils-core-1.8.0.jar;C:\Users\sebastien\.m2\repository\org\apache\avro\avro\1.7.4\avro-1.7.4.jar;C:\Users\sebastien\.m2\repository\com\thoughtworks\paranamer\paranamer\2.3\paranamer-2.3.jar;C:\Users\sebastien\.m2\repository\org\xerial\snappy\snappy-java\1.0.4.1\snappy-java-1.0.4.1.jar;C:\Users\sebastien\.m2\repository\com\jcraft\jsch\0.1.42\jsch-0.1.42.jar;C:\Users\sebastien\.m2\repository\org\apache\commons\commons-compress\1.4.1\commons-compress-1.4.1.jar;C:\Users\sebastien\.m2\repository\org\tukaani\xz\1.0\xz-1.0.jar;C:\Users\sebastien\.m2\repository\org\apache\hadoop\hadoop-mapreduce-client-core\2.5.1\hadoop-mapreduce-client-core-2.5.1.jar;C:\Users\sebastien\.m2\repository\org\apache\hadoop\hadoop-yarn-common\2.5.1\hadoop-yarn-common-2.5.1.jar;C:\Users\sebastien\.m2\repository\org\apache\hadoop\hadoop-yarn-api\2.5.1\hadoop-yarn-api-2.5.1.jar;C:\Users\sebastien\.m2\repository\javax\xml\bind\jaxb-api\2.2.2\jaxb-api-2.2.2.jar;C:\Users\sebastien\.m2\repository\javax\xml\stream\stax-api\1.0-2\stax-api-1.0-2.jar;C:\Users\sebastien\.m2\repository\javax\activation\activation\1.1\activation-1.1.jar;C:\Users\sebastien\.m2\repository\io\netty\netty\3.6.2.Final\netty-3.6.2.Final.jar;C:\Users\sebastien\.m2\repository\com\github\stephenc\findbugs\findbugs-annotations\1.3.9-1\findbugs-annotations-1.3.9-1.jar;C:\Users\sebastien\.m2\repository\junit\junit\4.11\junit-4.11.jar;C:\Users\sebastien\.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;C:\Users\sebastien\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar;C:\Program Files\Java\jdk1.8.0_102\lib\tools.jar;C:\Seb\DataLab\Dev\workspace\tuto1\src\main\resources\conf
2016-11-20 21:10:13 INFO  ZooKeeper:100 - Client environment:java.library.path=C:\Program Files\Java\jdk1.8.0_102\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:/Program Files/Java/jre1.8.0_102/bin/server;C:/Program Files/Java/jre1.8.0_102/bin;C:/Program Files/Java/jre1.8.0_102/lib/amd64;C:\Tools\xmlint;C:\Tools\apache-maven-3.2.5\bin;C:\Tools\;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Java\jdk1.8.0_102\bin;C:\Perl64\site\bin;C:\Perl64\bin;C:\IBM\WebSphere\AppServer\profiles\cw_profile\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Lenovo\Fingerprint Manager Pro\;C:\ProgramData\Lenovo\ReadyApps;C:\Program Files\ibm\gsk8\lib64;C:\Program Files (x86)\ibm\gsk8\lib;C:\Program Files\cURL\bin;C:\Tools\nodejs\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Nmap;C:\Users\sebastien\AppData\Roaming\npm;C:\Seb\DataLab\Dev\eclipse;;.
2016-11-20 21:10:13 INFO  ZooKeeper:100 - Client environment:java.io.tmpdir=C:\Users\SEBAST~1\AppData\Local\Temp\
2016-11-20 21:10:13 INFO  ZooKeeper:100 - Client environment:java.compiler=<NA>
2016-11-20 21:10:13 INFO  ZooKeeper:100 - Client environment:os.name=Windows 8.1
2016-11-20 21:10:13 INFO  ZooKeeper:100 - Client environment:os.arch=amd64
2016-11-20 21:10:13 INFO  ZooKeeper:100 - Client environment:os.version=6.3
2016-11-20 21:10:13 INFO  ZooKeeper:100 - Client environment:user.name=sebastien
2016-11-20 21:10:13 INFO  ZooKeeper:100 - Client environment:user.home=C:\Users\sebastien
2016-11-20 21:10:13 INFO  ZooKeeper:100 - Client environment:user.dir=C:\Seb\DataLab\Dev\workspace\tuto1
2016-11-20 21:10:13 INFO  ZooKeeper:438 - Initiating client connection, connectString=sandbox.hortonworks.com:2181 sessionTimeout=90000 watcher=hconnection-0x3224f60b0x0, quorum=sandbox.hortonworks.com:2181, baseZNode=/hbase-unsecure
2016-11-20 21:10:13 DEBUG ClientCnxn:102 - zookeeper.disableAutoWatchReset is false
2016-11-20 21:10:13 INFO  ClientCnxn:975 - Opening socket connection to server sandbox.hortonworks.com/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2016-11-20 21:10:13 INFO  ClientCnxn:852 - Socket connection established to sandbox.hortonworks.com/127.0.0.1:2181, initiating session
2016-11-20 21:10:13 DEBUG ClientCnxn:892 - Session establishment request sent on sandbox.hortonworks.com/127.0.0.1:2181
2016-11-20 21:10:13 INFO  ClientCnxn:1098 - Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect
2016-11-20 21:10:13 WARN  RecoverableZooKeeper:275 - Possibly transient ZooKeeper, quorum=sandbox.hortonworks.com:2181, exception=org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase-unsecure/hbaseid
2016-11-20 21:10:15 INFO  ClientCnxn:975 - Opening socket connection to server sandbox.hortonworks.com/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2016-11-20 21:10:15 INFO  ClientCnxn:852 - Socket connection established to sandbox.hortonworks.com/127.0.0.1:2181, initiating session
2016-11-20 21:10:15 DEBUG ClientCnxn:892 - Session establishment request sent on sandbox.hortonworks.com/127.0.0.1:2181
2016-11-20 21:10:15 WARN  ClientCnxn:1102 - Session 0x0 for server sandbox.hortonworks.com/127.0.0.1:2181, unexpected error, closing socket connection and attempting reconnect
java.io.IOException: Une connexion établie a été abandonnée par un logiciel de votre ordinateur hôte
    at sun.nio.ch.SocketDispatcher.read0(Native Method)
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
    at sun.nio.ch.IOUtil.read(IOUtil.java:192)
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doIO(ClientCnxnSocketNIO.java:68)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:366)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
2016-11-20 21:10:15 WARN  RecoverableZooKeeper:275 - Possibly transient ZooKeeper, quorum=sandbox.hortonworks.com:2181, exception=org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase-unsecure/hbaseid
2016-11-20 21:10:16 INFO  ClientCnxn:975 - Opening socket connection to server sandbox.hortonworks.com/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2016-11-20 21:10:16 INFO  ClientCnxn:852 - Socket connection established to sandbox.hortonworks.com/127.0.0.1:2181, initiating session
2016-11-20 21:10:16 DEBUG ClientCnxn:892 - Session establishment request sent on sandbox.hortonworks.com/127.0.0.1:2181
2016-11-20 21:10:16 WARN  ClientCnxn:1102 - Session 0x0 for server sandbox.hortonworks.com/127.0.0.1:2181, unexpected error, closing socket connection and attempting reconnect
java.io.IOException: Une connexion établie a été abandonnée par un logiciel de votre ordinateur hôte
    at sun.nio.ch.SocketDispatcher.read0(Native Method)
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
    at sun.nio.ch.IOUtil.read(IOUtil.java:192)
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doIO(ClientCnxnSocketNIO.java:68)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:366)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)

3 REPLIES 3

Re: Cannot reach HBase installed on HDP sandbox from a java client on the host

Could you confirm that you are able to reach port 2181 ( zookeeper ) from your host? (i tend to use telnet for this purpose)

If not, you will virtualbox to forward this port.

Highlighted

Re: Cannot reach HBase installed on HDP sandbox from a java client on the host

Rising Star

Hi Olivier,

Thanks for your help. I tried to proceed with following on my host :

  • telnet localhot:2181
  • telnet 127.0.0.1:2181
  • telnet 172.17.0.2:2181

All these commands failed, even if virtual box configuration redirects 2181 port, as shown on following screenshot :

9664-vm-redirect.png

Could the problem come from windows firewall ?

Highlighted

Re: Cannot reach HBase installed on HDP sandbox from a java client on the host

New Contributor

Hi Sebastien,

Have you got any solution for this problem. I am facing the same issue where I can run my app successfully from HortonWorks Sandbox VM but I was not successful when I run the same app from my windows machine. I can reach every port of hortonworks hdp from my windows machine (i did telnet host port).

Don't have an account?
Coming from Hortonworks? Activate your account here