3

我正在阅读 HBase 快速入门指南 ( http://hbase.apache.org/book/quickstart.html ),并且在完成第一步时遇到了很多问题。

我在以 Win7 作为主机的 VirtualBox 下使用 Mint Linux 13。

我下载了hbase 0.94.6.1,在我的home路径上解压文件,配置回环地址。出于测试目的,我可以写入 /tmp,因此我没有修改 /conf/hbase-site.xml。

start-hbase.sh: 45: [: false: unexpected operator
localhost: starting zookeeper, logging to /home/askldjd/hbase-0.94.6.1/bin/../logs/hbase-askldjd-zookeeper-test-hadoop.out
starting master, logging to /home/askldjd/hbase-0.94.6.1/bin/../logs/hbase-askldjd-master-test-hadoop.out
Could not start ZK at requested port of 2181.  ZK was started at port: 2182.  Aborting as clients (e.g. shell) will not be able to find this ZK quorum.
localhost: starting regionserver, logging to /home/askldjd/hbase-0.94.6.1/bin/../logs/hbase-askldjd-regionserver-test-hadoop.out

如果我输入 ./bin/hbase shell,然后输入状态,这就是我得到的。

13/04/05 01:47:06 ERROR client.HConnectionManager$HConnectionImplementation: Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master.

JAVA_HOME 已配置。

askldjd@test-hadoop ~ $ echo $JAVA_HOME
/usr/lib/jvm/java-6-openjdk-amd64/

我想我在这里遗漏了一些非常基本的东西。任何帮助将不胜感激。

谢谢

...艾伦

4

2 回答 2

7

根据日志消息,在默认端口(2181)中启动 Zookeeper 时出现问题

“无法在请求的 2181 端口启动 ZK。”

检查2181端口上是否有其他进程正在运行,如果是,请在停止2181端口上运行的进程后尝试启动hbase。

要不然

你可以单独运行 zookeeper 并告诉 hbase 使用它。

要使 hbase 使用您单独运行的 zookeeper,必须进行以下更改

  • conf/hbase-env.sh 中的 HBASE_MANAGES_ZK 变量必须设置为 false(这告诉 hbase 不要启动自己的 zookeeper 集成)

  • 在 conf/hbase-site.xml 中设置 zookeeper 值及其端口

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

参考以下链接配置和运行zookeeper:

http://zookeeper.apache.org/doc/r3.3.3/zookeeperStarted.html#sc_InstallingSingleMode

于 2013-04-10T16:07:12.553 回答
5

unexpected operator消息表明您可能遇到与我相同的问题:

你用它运行了sudo sh start-hbase.sh吗?相反,尝试sudo ./start-hbase.sh.

我真的不知道为什么,但sh似乎无法解释方括号。有关差异的更多详细信息:https ://askubuntu.com/questions/22910/what-is-the-difference-between-and-sh-to-run-a-script

于 2013-12-28T17:25:29.717 回答