jnorthrup jnorthrup - 3 months ago 7
Java Question

hbase standalone quickstart failure is repeateable via maven project

I have to launch an hbase process to a private hadoop cluster and need to simply demonstrate minimum functionality; installing hadoop is unnecessary for the demonstration. following the

QuickStart
apache hbase docs failed via shell and I have been able to duplicate the failures using a self contained maven project.
/etc/hosts
is not an issue.

I located a maven project which appears to have been built to deomnstrate this same functionality and updated the deps.

that project is here: hbase-demo

to repeat my results requires shell and two lines with maven installed:

git clone https://github.com/jnorthrup/hbase-demo
cd hbase-demo

$ mvn clean package exec:java
[INFO] Scanning for projects...
[INFO]
[...]

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ demo ---
[INFO] Building jar: /vol/big240/snap/jim/work/hbase-demo/target/demo-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] >>> exec-maven-plugin:1.2.1:java (default-cli) @ demo >>>
[INFO]
[INFO] <<< exec-maven-plugin:1.2.1:java (default-cli) @ demo <<<
[INFO]
[INFO] --- exec-maven-plugin:1.2.1:java (default-cli) @ demo ---
13/10/30 14:30:49 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version=3.4.5-1392090, built on 09/30/2012 17:52 GMT
13/10/30 14:30:49 INFO zookeeper.ZooKeeper: Client environment:host.name=localhost
13/10/30 14:30:49 INFO zookeeper.ZooKeeper: Client environment:java.version=1.7.0_40
13/10/30 14:30:49 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Oracle Corporation
13/10/30 14:30:49 INFO zookeeper.ZooKeeper: Client environment:java.home=/opt/jdk1.7.0_40/jre
13/10/30 14:30:49 INFO zookeeper.ZooKeeper: Client environment:java.class.path=/opt/maven/boot/plexus-classworlds-2.4.jar
13/10/30 14:30:49 INFO zookeeper.ZooKeeper: Client environment:java.library.path=:/opt/AMDAPP/lib/x86_64/:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
13/10/30 14:30:49 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp
13/10/30 14:30:49 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
13/10/30 14:30:49 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
13/10/30 14:30:49 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64
13/10/30 14:30:49 INFO zookeeper.ZooKeeper: Client environment:os.version=3.8.0-32-generic
13/10/30 14:30:49 INFO zookeeper.ZooKeeper: Client environment:user.name=jim
13/10/30 14:30:49 INFO zookeeper.ZooKeeper: Client environment:user.home=/home/jim
13/10/30 14:30:49 INFO zookeeper.ZooKeeper: Client environment:user.dir=/vol/big240/snap/jim/work/hbase-demo
13/10/30 14:30:49 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
13/10/30 14:30:49 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 13494@keyframe
13/10/30 14:30:49 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
13/10/30 14:30:49 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:735)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
13/10/30 14:30:49 WARN zookeeper.RecoverableZooKeeper: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
13/10/30 14:30:49 INFO util.RetryCounter: Sleeping 2000ms before retry #1...
13/10/30 14:30:50 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
13/10/30 14:30:50 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
[repeats]


any help reviving this demo code would be greatly appreciated. twiddling the hbase-site.xml makes no appreciable difference to zookeeper failures with standalone, either with shell or maven..

thanks

Answer

Change hbase-site.xml to point to your hbase server:

<property>
    <name>hbase.rootdir</name>
    <value>hdfs://<hbase machine name>:8020/hbase</value>
</property>

<property>
    <name>hbase.zookeeper.quorum</name>
    <value><zookeeper machine name></value>
</property>
Comments