无法启动HBase独立模式

时间:2013-04-05 05:52:09

标签: hbase

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

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

我下载了hbase 0.94.6.1,解压缩了我家路径上的文件,配置了环回地址。为了测试目的,我写入/ 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/

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

由于

......艾伦

2 个答案:

答案 0 :(得分: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

答案 1 :(得分:4)

根据日志消息,在默认端口(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

相关问题