Reply
Champion Alumni
Posts: 162
Registered: ‎02-11-2014

Connectivity Issue with Hbase

Below is the code I am using to connect to  Hbase from java 6.

 

public void getHbaseConnection(){
try{
Class.forName(driverName);
Configuration config = HBaseConfiguration.create();
config.set("hbase.master", "10.4.113.26:60000");
config.set("hbase.zookeeper.quorum", "10.4.113.30");
config.set("hbase.zookeeper.property.clientPort", "2181");
String tableName = "test";
System.out.println("Entered");
System.out.println(tableName);
HBaseAdmin admin = new HBaseAdmin(config);
if (admin.tableExists("test")){
System.out.println("Table EXISTS");
}else{
System.out.println("Table does not exist");
}
}
catch(Exception e){
e.printStackTrace();
}

 

I  am able to connect to hbase.When this program is run in de bug mode it goes till if (admin.tableExists("test")) and then stops.Below is the log.Can some one help?.

 

 

Apr 8, 2014 2:10:27 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:zookeeper.version=3.4.5-1392090, built on 09/30/2012 17:52 GMT
Apr 8, 2014 2:10:27 PM org.apache.zookeeper.Environment logEnv
Apr 8, 2014 2:10:27 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:java.version=1.6.0
Apr 8, 2014 2:10:27 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:java.vendor=IBM Corporation
Apr 8, 2014 2:10:27 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:java.home=C:\Program Files (x86)\IBM\WebSphere\AppServer\java\jre
Apr 8, 2014 2:10:27 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:java.class.path=C:\Users\Nishanth.Shajahan\IBM\rationalsdp\workspace_eLogging3\EnterpriseLoggingServiceProject\EnterpriseLoggingIndexJava\target\classes;C:\mnt\esb\shared_storage\ci\repository\org\apache\solr\solr-solrj\4.1.0\solr-solrj-4.1.0.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\zookeeper\zookeeper\3.4.5\zookeeper-3.4.5.jar;C:\mnt\esb\shared_storage\ci\repository\commons-io\commons-io\2.1\commons-io-2.1.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\httpcomponents\httpclient\4.1.3\httpclient-4.1.3.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\httpcomponents\httpcore\4.1.4\httpcore-4.1.4.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\httpcomponents\httpmime\4.1.3\httpmime-4.1.3.jar;C:\mnt\esb\shared_storage\ci\repository\org\codehaus\woodstox\wstx-asl\3.2.7\wstx-asl-3.2.7.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\solr\solr-core\4.1.0\solr-core-4.1.0.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\lucene\lucene-core\4.1.0\lucene-core-4.1.0.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\lucene\lucene-analyzers-common\4.1.0\lucene-analyzers-common-4.1.0.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\lucene\lucene-analyzers-kuromoji\4.1.0\lucene-analyzers-kuromoji-4.1.0.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\lucene\lucene-analyzers-morfologik\4.1.0\lucene-analyzers-morfologik-4.1.0.jar;C:\mnt\esb\shared_storage\ci\repository\org\carrot2\morfologik-polish\1.5.5\morfologik-polish-1.5.5.jar;C:\mnt\esb\shared_storage\ci\repository\org\carrot2\morfologik-stemming\1.5.5\morfologik-stemming-1.5.5.jar;C:\mnt\esb\shared_storage\ci\repository\org\carrot2\morfologik-fsa\1.5.5\morfologik-fsa-1.5.5.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\lucene\lucene-analyzers-phonetic\4.1.0\lucene-analyzers-phonetic-4.1.0.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\lucene\lucene-highlighter\4.1.0\lucene-highlighter-4.1.0.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\lucene\lucene-memory\4.1.0\lucene-memory-4.1.0.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\lucene\lucene-misc\4.1.0\lucene-misc-4.1.0.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\lucene\lucene-queryparser\4.1.0\lucene-queryparser-4.1.0.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\lucene\lucene-spatial\4.1.0\lucene-spatial-4.1.0.jar;C:\mnt\esb\shared_storage\ci\repository\com\spatial4j\spatial4j\0.3\spatial4j-0.3.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\lucene\lucene-suggest\4.1.0\lucene-suggest-4.1.0.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\lucene\lucene-grouping\4.1.0\lucene-grouping-4.1.0.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\lucene\lucene-queries\4.1.0\lucene-queries-4.1.0.jar;C:\mnt\esb\shared_storage\ci\repository\commons-codec\commons-codec\1.7\commons-codec-1.7.jar;C:\mnt\esb\shared_storage\ci\repository\commons-cli\commons-cli\1.2\commons-cli-1.2.jar;C:\mnt\esb\shared_storage\ci\repository\commons-fileupload\commons-fileupload\1.2.1\commons-fileupload-1.2.1.jar;C:\mnt\esb\shared_storage\ci\repository\org\slf4j\jcl-over-slf4j\1.6.4\jcl-over-slf4j-1.6.4.jar;C:\mnt\esb\shared_storage\ci\repository\org\slf4j\slf4j-jdk14\1.6.4\slf4j-jdk14-1.6.4.jar;C:\mnt\esb\shared_storage\ci\repository\com\google\guava\guava\13.0.1\guava-13.0.1.jar;C:\mnt\esb\shared_storage\ci\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;C:\mnt\esb\shared_storage\ci\repository\org\slf4j\slf4j-api\1.6.4\slf4j-api-1.6.4.jar;C:\Users\Nishanth.Shajahan\IBM\rationalsdp\workspace_eLogging3\EnterpriseLoggingConfigProject\target\classes;C:\mnt\esb\shared_storage\ci\repository\com\soa\lib\common\technical\monitoring\ServiceMonitoringLibraryProject\1.3.0-SNAPSHOT\ServiceMonitoringLibraryProject-1.3.0-SNAPSHOT.jar;C:\mnt\esb\shared_storage\ci\repository\com\kenai\nbpwr\org-apache-commons-io\1.3.1-201002241208\org-apache-commons-io-1.3.1-201002241208.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\hbase\hbase-client\0.98.0-hadoop1\hbase-client-0.98.0-hadoop1.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\hbase\hbase-common\0.98.0-hadoop1\hbase-common-0.98.0-hadoop1.jar;C:\mnt\esb\shared_storage\ci\repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;C:\mnt\esb\shared_storage\ci\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\hbase\hbase-protocol\0.98.0-hadoop1\hbase-protocol-0.98.0-hadoop1.jar;C:\mnt\esb\shared_storage\ci\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;C:\mnt\esb\shared_storage\ci\repository\com\google\protobuf\protobuf-java\2.5.0\protobuf-java-2.5.0.jar;C:\mnt\esb\shared_storage\ci\repository\io\netty\netty\3.6.6.Final\netty-3.6.6.Final.jar;C:\mnt\esb\shared_storage\ci\repository\org\cloudera\htrace\htrace-core\2.04\htrace-core-2.04.jar;C:\mnt\esb\shared_storage\ci\repository\org\mortbay\jetty\jetty-util\6.1.26\jetty-util-6.1.26.jar;C:\mnt\esb\shared_storage\ci\repository\org\codehaus\jackson\jackson-mapper-asl\1.8.8\jackson-mapper-asl-1.8.8.jar;C:\mnt\esb\shared_storage\ci\repository\org\codehaus\jackson\jackson-core-asl\1.8.8\jackson-core-asl-1.8.8.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\hadoop\hadoop-core\1.2.1\hadoop-core-1.2.1.jar;C:\mnt\esb\shared_storage\ci\repository\xmlenc\xmlenc\0.52\xmlenc-0.52.jar;C:\mnt\esb\shared_storage\ci\repository\com\sun\jersey\jersey-core\1.8\jersey-core-1.8.jar;C:\mnt\esb\shared_storage\ci\repository\com\sun\jersey\jersey-json\1.8\jersey-json-1.8.jar;C:\mnt\esb\shared_storage\ci\repository\org\codehaus\jettison\jettison\1.1\jettison-1.1.jar;C:\mnt\esb\shared_storage\ci\repository\stax\stax-api\1.0.1\stax-api-1.0.1.jar;C:\mnt\esb\shared_storage\ci\repository\com\sun\xml\bind\jaxb-impl\2.2.3-1\jaxb-impl-2.2.3-1.jar;C:\mnt\esb\shared_storage\ci\repository\javax\xml\bind\jaxb-api\2.2.2\jaxb-api-2.2.2.jar;C:\mnt\esb\shared_storage\ci\repository\javax\xml\stream\stax-api\1.0-2\stax-api-1.0-2.jar;C:\mnt\esb\shared_storage\ci\repository\javax\activation\activation\1.1\activation-1.1.jar;C:\mnt\esb\shared_storage\ci\repository\org\codehaus\jackson\jackson-jaxrs\1.7.1\jackson-jaxrs-1.7.1.jar;C:\mnt\esb\shared_storage\ci\repository\org\codehaus\jackson\jackson-xc\1.7.1\jackson-xc-1.7.1.jar;C:\mnt\esb\shared_storage\ci\repository\com\sun\jersey\jersey-server\1.8\jersey-server-1.8.jar;C:\mnt\esb\shared_storage\ci\repository\asm\asm\3.1\asm-3.1.jar;C:\mnt\esb\shared_storage\ci\repository\commons-httpclient\commons-httpclient\3.0.1\commons-httpclient-3.0.1.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\commons\commons-math\2.1\commons-math-2.1.jar;C:\mnt\esb\shared_storage\ci\repository\commons-configuration\commons-configuration\1.6\commons-configuration-1.6.jar;C:\mnt\esb\shared_storage\ci\repository\commons-digester\commons-digester\1.8\commons-digester-1.8.jar;C:\mnt\esb\shared_storage\ci\repository\commons-beanutils\commons-beanutils\1.7.0\commons-beanutils-1.7.0.jar;C:\mnt\esb\shared_storage\ci\repository\commons-beanutils\commons-beanutils-core\1.8.0\commons-beanutils-core-1.8.0.jar;C:\mnt\esb\shared_storage\ci\repository\commons-net\commons-net\1.4.1\commons-net-1.4.1.jar;C:\mnt\esb\shared_storage\ci\repository\org\mortbay\jetty\jetty\6.1.26\jetty-6.1.26.jar;C:\mnt\esb\shared_storage\ci\repository\org\mortbay\jetty\servlet-api\2.5-20081211\servlet-api-2.5-20081211.jar;C:\mnt\esb\shared_storage\ci\repository\tomcat\jasper-runtime\5.5.12\jasper-runtime-5.5.12.jar;C:\mnt\esb\shared_storage\ci\repository\tomcat\jasper-compiler\5.5.12\jasper-compiler-5.5.12.jar;C:\mnt\esb\shared_storage\ci\repository\org\mortbay\jetty\jsp-api-2.1\6.1.14\jsp-api-2.1-6.1.14.jar;C:\mnt\esb\shared_storage\ci\repository\org\mortbay\jetty\servlet-api-2.5\6.1.14\servlet-api-2.5-6.1.14.jar;C:\mnt\esb\shared_storage\ci\repository\org\mortbay\jetty\jsp-2.1\6.1.14\jsp-2.1-6.1.14.jar;C:\mnt\esb\shared_storage\ci\repository\ant\ant\1.6.5\ant-1.6.5.jar;C:\mnt\esb\shared_storage\ci\repository\commons-el\commons-el\1.0\commons-el-1.0.jar;C:\mnt\esb\shared_storage\ci\repository\com\github\stephenc\findbugs\findbugs-annotations\1.3.9-1\findbugs-annotations-1.3.9-1.jar;C:\mnt\esb\shared_storage\ci\repository\org\apache\geronimo\specs\geronimo-j2ee_1.4_spec\1.1\geronimo-j2ee_1.4_spec-1.1.jar;C:\mnt\esb\shared_storage\ci\repository\javaee\javaee-api\5\javaee-api-5.jar
Apr 8, 2014 2:10:27 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:java.library.path=C:\Program Files (x86)\IBM\WebSphere\AppServer\java\jre\bin\default;C:\Program Files (x86)\IBM\WebSphere\AppServer\java\jre\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\IBM\WebSphere\AppServer\java\jre\bin;C:\Program Files (x86)\IBM\WebSphere MQ\Java\lib;C:\Program Files (x86)\IBM\WebSphere MQ\Java\lib64;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;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\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;;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\Java\jdk1.6.0_45\bin;C:\work\installables\apache-maven-3.1.1\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\IBM\WebSphere MQ\bin64;C:\Program Files (x86)\IBM\WebSphere MQ\bin;C:\Program Files (x86)\IBM\WebSphere MQ\tools\c\samples\bin;.
Apr 8, 2014 2:10:27 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:java.io.tmpdir=C:\Users\NISHAN~1.SHA\AppData\Local\Temp\
Apr 8, 2014 2:10:27 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:java.compiler=j9jit26
Apr 8, 2014 2:10:27 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:os.name=Windows 7
Apr 8, 2014 2:10:27 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:os.arch=amd64
Apr 8, 2014 2:10:27 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:os.version=6.1
Apr 8, 2014 2:10:27 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:user.name=Nishanth.Shajahan
Apr 8, 2014 2:10:27 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:user.home=C:\Users\Nishanth.Shajahan
Apr 8, 2014 2:10:27 PM org.apache.zookeeper.Environment logEnv
INFO: Client environment:user.dir=C:\Users\Nishanth.Shajahan\IBM\rationalsdp\workspace_eLogging3\EnterpriseLoggingServiceProject\EnterpriseLoggingIndexJava
Apr 8, 2014 2:10:27 PM org.apache.zookeeper.ZooKeeper <init>
INFO: Initiating client connection, connectString=10.4.113.30:2181 sessionTimeout=90000 watcher=hconnection-0x78bc17d9, quorum=10.4.113.30:2181, baseZNode=/hbase
Apr 8, 2014 2:10:27 PM org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper <init>
INFO: Process identifier=hconnection-0x78bc17d9 connecting to ZooKeeper ensemble=10.4.113.30:2181
Apr 8, 2014 2:10:32 PM org.apache.zookeeper.ClientCnxn$SendThread logStartConnect
INFO: Opening socket connection to server 10.4.113.30/10.4.113.30:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
Apr 8, 2014 2:10:32 PM org.apache.zookeeper.ClientCnxn$SendThread primeConnection
INFO: Socket connection established to 10.4.113.30/10.4.113.30:2181, initiating session
Apr 8, 2014 2:10:32 PM org.apache.zookeeper.ClientCnxn$SendThread onConnected
INFO: Session establishment complete on server 10.4.113.30/10.4.113.30:2181, sessionid = 0x544fb00042d5c84, negotiated timeout = 60000
Apr 8, 2014 2:10:37 PM org.apache.zookeeper.ZooKeeper <init>
INFO: Initiating client connection, connectString=10.4.113.30:2181 sessionTimeout=90000 watcher=catalogtracker-on-hconnection-0x78bc17d9, quorum=10.4.113.30:2181, baseZNode=/hbase
Apr 8, 2014 2:10:37 PM org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper <init>
INFO: Process identifier=catalogtracker-on-hconnection-0x78bc17d9 connecting to ZooKeeper ensemble=10.4.113.30:2181
Apr 8, 2014 2:10:42 PM org.apache.zookeeper.ClientCnxn$SendThread logStartConnect
INFO: Opening socket connection to server 10.4.113.30/10.4.113.30:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
Apr 8, 2014 2:10:42 PM org.apache.zookeeper.ClientCnxn$SendThread primeConnection
INFO: Socket connection established to 10.4.113.30/10.4.113.30:2181, initiating session
Apr 8, 2014 2:10:42 PM org.apache.zookeeper.ClientCnxn$SendThread onConnected
INFO: Session establishment complete on server 10.4.113.30/10.4.113.30:2181, sessionid = 0x544fb00042d5c85, negotiated timeout = 60000

 

 

 

 

 

Champion Alumni
Posts: 162
Registered: ‎02-11-2014

Re: Connectivity Issue with Hbase

I am able to connect to hbase and create tables when I use the hbase shell.But when I run the above java code from a  windows machine ,I  am getting these errors.Firewall has been opened for  zoo keeper port as well.

Announcements