4

我想测试 HBql 以简单地使用 HBase。我按照 HBql 网站 ( http://www.hbql.com/installation.html ) 上描述的步骤进行操作。最后,在 HBql-console 中键入 version-command 以验证我的安装时,我收到以下消息:

[main] INFO org.apache.zookeeper.ZooKeeper - Client environment:zookeeper.version=3.4.4-1386507, built on 09/17/2012 08:33 GMT
[main] INFO org.apache.zookeeper.ZooKeeper - Client environment:host.name=aleebi
[main] INFO org.apache.zookeeper.ZooKeeper - Client environment:java.version=1.6.0_18
[main] INFO org.apache.zookeeper.ZooKeeper - Client environment:java.vendor=Sun Microsystems Inc.
[main] INFO org.apache.zookeeper.ZooKeeper - Client environment:java.home=/usr/lib/jvm/java-6-openjdk/jre
[main] INFO org.apache.zookeeper.ZooKeeper - Client environment:java.class.path=:/usr/local/hbase-0.94.2/hbase-0.94.2.jar:/usr/local/hadoop-1.0.4/hadoop-core-1.0.4.jar:/usr/local/hadoop-1.0.4/contrib/index/hadoop-index-1.0.4.jar:/usr/local/hbql-0.90.0.1/hbql-0.90.0.1.jar:/usr/local/hbase-transactional-tableindexed/org/apache/hbase-trx-0.90.0RC3.jar:/usr/local/hbql-0.90.0.1/lib/antlr-runtime-3.1.3.jar:/usr/local/hbql-0.90.0.1/lib/jline-0.9.94.jar:/usr/local/commons-logging-1.1.1/commons-logging-1.1.1.jar:/usr/local/hbase-0.94.2/lib:/usr/local/hadoop-1.0.4/lib:/usr/local/commons-configuration-1.9/commons-configuration-1.9.jar:/usr/local/commons-configuration-1.9/apache-commons-lang.jar:/usr/local/zookeeper-3.4.4/zookeeper-3.4.4.jar:/usr/local/slf4j-1.7.2/slf4j-api-1.7.2.jar:/usr/local/slf4j-1.7.2/slf4j-simple-1.7.2.jar::/usr/local/hbql-0.90.0.1/lib/jline-0.9.94.jar:/usr/local/hbql-0.90.0.1/lib/antlr-runtime-3.1.3.jar:/usr/local/hbql-0.90.0.1/hbql-0.90.0.1
[main] INFO org.apache.zookeeper.ZooKeeper - Client environment:java.library.path=/usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib/jni:/lib:/usr/lib
[main] INFO org.apache.zookeeper.ZooKeeper - Client environment:java.io.tmpdir=/tmp
[main] INFO org.apache.zookeeper.ZooKeeper - Client environment:java.compiler=<NA>
[main] INFO org.apache.zookeeper.ZooKeeper - Client environment:os.name=Linux
[main] INFO org.apache.zookeeper.ZooKeeper - Client environment:os.arch=amd64
[main] INFO org.apache.zookeeper.ZooKeeper - Client environment:os.version=2.6.32-5-amd64
[main] INFO org.apache.zookeeper.ZooKeeper - Client environment:user.name=aleebi
[main] INFO org.apache.zookeeper.ZooKeeper - Client environment:user.home=/home/aleebi
[main] INFO org.apache.zookeeper.ZooKeeper - Client environment:user.dir=/usr/local/hbql-0.90.0.1
[main] INFO org.apache.zookeeper.ZooKeeper - Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
[main-SendThread(localhost:2181)] INFO org.apache.zookeeper.ClientCnxn - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
[main-SendThread(localhost:2181)] WARN org.apache.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:592)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:348)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
24.10.2012 12:57:55 org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper <init>
INFO: The identifier of this process is 4698@aleebi
24.10.2012 12:57:55 org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper retryOrThrow
WARNUNG: Possibly transient ZooKeeper exception: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/master
24.10.2012 12:57:55 org.apache.hadoop.hbase.util.RetryCounter sleepUntilNextRetry   

这些消息仅在使用 HBql 控制台时打印。HBase 在分布式模式下成功运行,在 Debian Squeeze 上将数据存储在 HDFS 中。您需要更多信息吗?我犯了什么错误?为什么这里需要 SASL,而在 HBase shell 这样的一般情况下不需要?

也许一些重要的配置:

hbase-env.sh

hbase_manage_zk=true

hbase-site.xml

    <property>
      <name>hbase.zookeeper.property.clientPort</name>
      <value>2222</value>
    </property>
    <property>
      <name>hbase.zookeeper.quorum</name>
      <value>master</value>
    </property>
    <property>
      <name>hbase.zookeeper.property.dataDir</name>
      <value>/usr/local/zookeeper</value>
    </property>

谢谢你!

4

2 回答 2

2

我最近使用 Nutch 和 Solr 安装了 HBase,并且遇到了类似的问题。我不确定是否完全相同,不幸的是我不再有日志,但它肯定与连接相关。

原来 ZooKeeper 的默认连接限制太低,增加这个值为hbase-site.xml我解决了这个问题:

<property>
    <name>hbase.zookeeper.property.maxClientCnxns</name>
    <value>1000</value>
</property>
于 2012-10-31T16:43:25.433 回答
0

我有同样的问题。这个答案假设您在 linux 上工作并相应地编辑了您的 etc/hosts 文件(https://stackoverflow.com/a/13540883/1607022

Zookeeper 的客户端端口号必须在 HBase 的配置文件中以及您在其之上使用的任何内容中相同。解决方案是;(在我的情况下,HBASE 0.90.4 和 GORA 0.3)检查 HBASE_HOME/src/main/resources 下的 hbase-default.xml:

<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>

并且在 HBql 下应该有一个 hbase-site.xml:

<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
<description>Property from ZooKeeper's config zoo.cfg.
The port at which the clients will connect.
</description>
</property>

端口号应该相同。

于 2013-07-23T12:15:04.090 回答