Reply
Highlighted
Explorer
Posts: 62
Registered: ‎01-22-2014

HBase Scala API connectivity error

Hi,

 

I am trying to write data into HBase from scala using the examples given in http://wiki.apache.org/hadoop/Hbase/Scala and http://www.vidyasource.com/blog/Programming/Scala/Java/Data/Hadoop/Analytics/2014/01/25/lighting-a-s...

 

But I am getting the same error as mentioned below in both the codes while calling the methiod HBaseadmin(conf).

 

Please let me knoe how to reslove this error . Thanks!

 

4/06/05 16:36:31 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version=3.3.2-1031432, built on 11/05/2010 05:32 GMT
14/06/05 16:36:31 INFO zookeeper.ZooKeeper: Client environment:host.name=ip-10-37-156-45.ec2.internal
14/06/05 16:36:31 INFO zookeeper.ZooKeeper: Client environment:java.version=1.7.0_21
14/06/05 16:36:31 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Oracle Corporation
14/06/05 16:36:31 INFO zookeeper.ZooKeeper: Client environment:java.home=/usr/java/jdk1.7.0_21/jre
14/06/05 16:36:31 INFO zookeeper.ZooKeeper: Client environment:java.class.path=/home/vishwast/bin/sbt-launch.jar
14/06/05 16:36:31 INFO zookeeper.ZooKeeper: Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
14/06/05 16:36:31 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp
14/06/05 16:36:31 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
14/06/05 16:36:31 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
14/06/05 16:36:31 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64
14/06/05 16:36:31 INFO zookeeper.ZooKeeper: Client environment:os.version=2.6.32-279.el6.x86_64
14/06/05 16:36:31 INFO zookeeper.ZooKeeper: Client environment:user.name=root
14/06/05 16:36:31 INFO zookeeper.ZooKeeper: Client environment:user.home=/root
14/06/05 16:36:31 INFO zookeeper.ZooKeeper: Client environment:user.dir=/home/arun/scala/hbasesample1
14/06/05 16:36:31 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=ip-10-37-156-45.ec2.internal:2181 sessionTimeout=180000 watcher=hconnection
14/06/05 16:36:31 INFO zookeeper.ClientCnxn: Opening socket connection to server ip-10-37-156-45.ec2.internal/10.37.156.45:2181
14/06/05 16:36:31 INFO zookeeper.ClientCnxn: Socket connection established to ip-10-37-156-45.ec2.internal/10.37.156.45:2181, initiating session
14/06/05 16:36:31 INFO zookeeper.ClientCnxn: Session establishment complete on server ip-10-37-156-45.ec2.internal/10.37.156.45:2181, sessionid = 0x14661267c6e1a0c, negotiated timeout = 60000
[error] (run-main-0) java.lang.NumberFormatException: For input string: "60000e���ȉaPBUF
[error] )
[error] ip-10-37-156-45.ec2.internal�������("
java.lang.NumberFormatException: For input string: "60000e���ȉaPBUF
)
ip-10-37-156-45.ec2.internal�������("
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:492)
	at java.lang.Integer.parseInt(Integer.java:527)
	at org.apache.hadoop.hbase.HServerAddress.<init>(HServerAddress.java:63)
	at org.apache.hadoop.hbase.MasterAddressTracker.getMasterAddress(MasterAddressTracker.java:63)
	at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:354)
	at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:94)
	at me.handol.scala.HBaseSample1$.main(HBaseSample1.scala:40)
	at me.handol.scala.HBaseSample1.main(HBaseSample1.scala)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
[trace] Stack trace suppressed: run last compile:run for the full output.
14/06/05 16:36:31 ERROR zookeeper.ClientCnxn: Event thread exiting due to interruption
java.lang.InterruptedException
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2017)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2052)
	at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
	at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:502)
14/06/05 16:36:31 INFO zookeeper.ClientCnxn: EventThread shut down
java.lang.RuntimeException: Nonzero exit code: 1
	at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) Nonzero exit code: 1
[error] Total time: 12 s, completed 5 Jun, 2014 4:36:31 PM
> 14/06/05 16:36:51 WARN zookeeper.ClientCnxn: Session 0x14661267c6e1a0c for server ip-10-37-156-45.ec2.internal/10.37.156.45:2181, unexpected error, closing socket connection and attempting reconnect
java.nio.channels.ClosedByInterruptException

 

Posts: 1,836
Kudos: 415
Solutions: 295
Registered: ‎07-31-2013

Re: HBase Scala API connectivity error

Your error is stemming from the fact that your client library versions do not match your cluster one.

Per the data in your provided log, it can be said that your cluster HBase version is likely 0.96+, but the client is most definitely 0.94 or below, both of which are incompatible with one another when asked to communicate.

Ensuring that your client HBase library versions are also of the same version as the server will help resolve this.
Announcements