hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Vandenabeele <pe...@vandenabeele.com>
Subject client.PutExample from "HBase: The Definitive Guide" fails with ZooKeeperConnectionException
Date Sun, 04 Mar 2012 12:49:02 GMT
Hi,

I am new to HBase and now working in  "HBase: The Definitive Guide"
(recent eBook version). I am trying to run

  $ bin/run.sh client.PutExample

on Page xxiii Preface. That is based on code in ch03 from

 https://github.com/larsgeorge/hbase-book

(there is a known issue with a ch04 and ch03 mix-up
http://oreilly.com/catalog/errata.csp?isbn=0636920014348
but I don't think that is the issue here)

I was able to successfully run:

$ mvn --version
Apache Maven 2.2.1 (rdebian-6)
Java version: 1.6.0_26
Java home: /usr/lib/jvm/java-6-sun-1.6.0.26/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "3.0.0-16-generic-pae" arch: "i386" Family: "unix"

~/b/github/petervandenabeele/hbase-book$ mvn package
...
lots of warnings like this:
[INFO] Unable to find resource 'asm:asm-tree:jar:3.1' in repository
maven2-repository.dev.java.net (http://download.java.net/maven/2/)
Downloading: http://people.apache.org/~larsgeorge/repo//asm/asm-tree/3.1/asm-tree-3.1.jar
[INFO] Unable to find resource
'org.codehaus.jackson:jackson-core-asl:jar:1.4.2' in repository
hadoop-non-releases (http://people.apache.org/~larsgeorge/repo/)
Downloading: https://repository.apache.org/content/repositories/releases//org/codehaus/jackson/jackson-core-asl/1.4.2/jackson-core-asl-1.4.2.jar
[INFO] Unable to find resource 'org.slf4j:slf4j-log4j12:jar:1.5.8' in
repository codehaus (http://repository.codehaus.org/)
Downloading: http://repository.jboss.org/nexus/content/groups/public-jboss//org/slf4j/slf4j-log4j12/1.5.8/slf4j-log4j12-1.5.8.jar
168K downloaded  (httpcore-4.0.1.jar)
[INFO] Unable to find resource
'org.apache.geronimo.specs:geronimo-annotation_1.0_spec:jar:1.1.1' in
repository cloudera
(https://repository.cloudera.com/content/repositories/releases)
Downloading: http://download.java.net/maven/2//org/apache/geronimo/specs/geronimo-annotation_1.0_spec/1.1.1/geronimo-annotation_1.0_spec-1.1.1.jar
...

[INFO] HBase Book ............................................ SUCCESS
[1:39.930s]
[INFO] HBase Book Chapter 3 .................................. SUCCESS
[1:45.223s]
[INFO] HBase Book Chapter 4 .................................. SUCCESS [0.595s]
[INFO] HBase Book Chapter 5 .................................. SUCCESS [0.393s]
[INFO] HBase Book Chapter 6 .................................. SUCCESS [14.987s]
[INFO] HBase Book Chapter 7 .................................. SUCCESS [53.430s]
[INFO] HBase Book Chapter 9 .................................. SUCCESS [0.283s]
[INFO] HBase Book Chapter 11 ................................. SUCCESS [0.341s]
[INFO] HBase URL Shortener ................................... SUCCESS
[2:35.249s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7 minutes 10 seconds
[INFO] Finished at: Sun Mar 04 12:27:57 CET 2012
[INFO] Final Memory: 58M/130M
[INFO] ------------------------------------------------------------------------

But running the client.PutExample (and the GetExample) fails:

~/b/github/petervandenabeele/hbase-book/ch03$ bin/run.sh client.PutExample
 WARN [main-SendThread(localhost:2181)] (ClientCnxn.java:1161) -
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:567)
	at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
 WARN [main-SendThread(localhost:2181)] (ClientCnxn.java:1161) -
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:567)
	at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
 WARN [main-SendThread(localhost:2181)] (ClientCnxn.java:1161) -
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:567)
	at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
 WARN [main-SendThread(localhost:2181)] (ClientCnxn.java:1161) -
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:567)
	at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
 WARN [main-SendThread(localhost:2181)] (ClientCnxn.java:1161) -
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:567)
	at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
 WARN [main-SendThread(localhost:2181)] (ClientCnxn.java:1161) -
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:567)
	at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
 WARN [main-SendThread(localhost:2181)] (ClientCnxn.java:1161) -
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:567)
	at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1119)
Exception in thread "main"
org.apache.hadoop.hbase.ZooKeeperConnectionException: HBase is able to
connect to ZooKeeper but the connection closes immediately. This could
be a sign that the server has too many connections (30 is the
default). Consider inspecting your ZK server logs for that error and
then make sure you are reusing HBaseConfiguration as often as you can.
See HTable's javadoc for more information.
	at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:160)
	at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getZooKeeperWatcher(HConnectionManager.java:1255)
	at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.setupZookeeperTrackers(HConnectionManager.java:515)
	at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.<init>(HConnectionManager.java:506)
	at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:180)
	at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:90)
	at util.HBaseHelper.<init>(HBaseHelper.java:29)
	at util.HBaseHelper.getHelper(HBaseHelper.java:33)
	at client.PutExample.main(PutExample.java:22)
Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException:
KeeperErrorCode = ConnectionLoss for /hbase
	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:809)
	at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:837)
	at org.apache.hadoop.hbase.zookeeper.ZKUtil.createAndFailSilent(ZKUtil.java:803)
	at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:138)
	... 8 more

I presume, I must be missing something trivial about Zookeeper. Actually,
where do I find the Zookeeper server logs that are refered to above ?

I am on Ubuntu and have already changed my /etc/hosts to read:

$ cat /etc/hosts
127.0.0.1	localhost
127.0.0.1	vandesco-001 # was 127.0.1.1 changed for lily
127.0.0.1       sub.test.localhost

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Thanks for any hints,

Peter

Mime
View raw message