1

我必须向私有 hadoop 集群启动一个 hbase 进程,并且需要简单地演示最低功能;演示不需要安装 hadoop。在QuickStartapache hbase 文档通过 shell 失败之后,我已经能够使用自包含的 maven 项目复制失败。 /etc/hosts不是问题。

我找到了一个 maven 项目,它似乎是为了演示相同的功能而构建的,并更新了 deps。

该项目在这里:hbase-demo

重复我的结果需要shell和两行安装了maven:

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]

任何帮助恢复此演示代码将不胜感激。旋转 hbase-site.xml 对 Zookeeper 的独立失败没有明显的影响,无论是 shell 还是 maven ..

谢谢

4

1 回答 1

1

更改 hbase-site.xml 以指向您的 hbase 服务器:

<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>
于 2013-11-03T12:53:44.210 回答