Startin HBase Shell - Zookeeper存在但失败

时间:2015-12-03 12:41:18

标签: linux hadoop hbase apache-zookeeper

我正在尝试在Ubuntu上运行HBase。我已经安装了它并且可以启动它(因为我使用的是64位系统而引发了一些警告,但是我告诉我可以忽略它们)。但是,当我尝试启动shell时,我会收到下面的错误消息,但我是新手,所以我很难弄明白。它说Zookeeper存在但已经失败了4次 - 你知道为什么吗?

2015-12-03 12:34:37,796 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
2015-12-03 12:34:54,551 ERROR [main] zookeeper.RecoverableZooKeeper: ZooKeeper exists failed after 4 attempts
2015-12-03 12:34:54,552 WARN  [main] zookeeper.ZKUtil: hconnection-0x2b289ac90x0, quorum=localhost:2181, baseZNode=/hbase Unable to set watcher on znode (/hbase/hbaseid)
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1045)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:221)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.checkExists(ZKUtil.java:541)
    at org.apache.hadoop.hbase.zookeeper.ZKClusterId.readClusterIdZNode(ZKClusterId.java:65)
    at org.apache.hadoop.hbase.client.ZooKeeperRegistry.getClusterId(ZooKeeperRegistry.java:105)
    at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.retrieveClusterId(ConnectionManager.java:879)
    at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.<init>(ConnectionManager.java:635)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:238)
    at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:218)
    at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:119)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:450)
    at org.jruby.javasupport.JavaMethod.invokeStaticDirect(JavaMethod.java:362)
    at org.jruby.java.invokers.StaticMethodInvoker.call(StaticMethodInvoker.java:58)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
    at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
    at org.jruby.ast.InstAsgnNode.interpret(InstAsgnNode.java:95)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:169)
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:191)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:302)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:144)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:148)
    at org.jruby.RubyClass.newInstance(RubyClass.java:822)
    at org.jruby.RubyClass$i$newInstance.call(RubyClass$i$newInstance.gen:65535)
    at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrNBlock.call(JavaMethod.java:249)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:292)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:135)
    at home.jordan.hbase_minus_1_dot_1_dot_2.bin.$_dot_dot_.bin.hirb.__file__(/home/jordan/hbase-1.1.2/bin/../bin/hirb.rb:118)
    at home.jordan.hbase_minus_1_dot_1_dot_2.bin.$_dot_dot_.bin.hirb.load(/home/jordan/hbase-1.1.2/bin/../bin/hirb.rb)
    at org.jruby.Ruby.runScript(Ruby.java:697)
    at org.jruby.Ruby.runScript(Ruby.java:690)
    at org.jruby.Ruby.runNormally(Ruby.java:597)
    at org.jruby.Ruby.runFromMain(Ruby.java:446)
    at org.jruby.Main.doRunFromMain(Main.java:369)
    at org.jruby.Main.internalRun(Main.java:258)
    at org.jruby.Main.run(Main.java:224)
    at org.jruby.Main.run(Main.java:208)
    at org.jruby.Main.main(Main.java:188)
2015-12-03 12:34:54,556 ERROR [main] zookeeper.ZooKeeperWatcher: hconnection-0x2b289ac90x0, quorum=localhost:2181, baseZNode=/hbase Received unexpected KeeperException, re-throwing exception
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
    at org.apache.zookeeper.ZooKeeper.exists(ZooKeeper.java:1045)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.exists(RecoverableZooKeeper.java:221)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.checkExists(ZKUtil.java:541)
    at org.apache.hadoop.hbase.zookeeper.ZKClusterId.readClusterIdZNode(ZKClusterId.java:65)
    at org.apache.hadoop.hbase.client.ZooKeeperRegistry.getClusterId(ZooKeeperRegistry.java:105)
    at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.retrieveClusterId(ConnectionManager.java:879)
    at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.<init>(ConnectionManager.java:635)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:238)
    at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:218)
    at org.apache.hadoop.hbase.client.ConnectionFactory.createConnection(ConnectionFactory.java:119)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:450)
    at org.jruby.javasupport.JavaMethod.invokeStaticDirect(JavaMethod.java:362)
    at org.jruby.java.invokers.StaticMethodInvoker.call(StaticMethodInvoker.java:58)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
    at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
    at org.jruby.ast.InstAsgnNode.interpret(InstAsgnNode.java:95)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:169)
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:191)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:302)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:144)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:148)
    at org.jruby.RubyClass.newInstance(RubyClass.java:822)
    at org.jruby.RubyClass$i$newInstance.call(RubyClass$i$newInstance.gen:65535)
    at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrNBlock.call(JavaMethod.java:249)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:292)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:135)
    at home.jordan.hbase_minus_1_dot_1_dot_2.bin.$_dot_dot_.bin.hirb.__file__(/home/jordan/hbase-1.1.2/bin/../bin/hirb.rb:118)
    at home.jordan.hbase_minus_1_dot_1_dot_2.bin.$_dot_dot_.bin.hirb.load(/home/jordan/hbase-1.1.2/bin/../bin/hirb.rb)
    at org.jruby.Ruby.runScript(Ruby.java:697)
    at org.jruby.Ruby.runScript(Ruby.java:690)
    at org.jruby.Ruby.runNormally(Ruby.java:597)
    at org.jruby.Ruby.runFromMain(Ruby.java:446)
    at org.jruby.Main.doRunFromMain(Main.java:369)
    at org.jruby.Main.internalRun(Main.java:258)
    at org.jruby.Main.run(Main.java:224)
    at org.jruby.Main.run(Main.java:208)
    at org.jruby.Main.main(Main.java:188)

3 个答案:

答案 0 :(得分:2)

由于以下一个或所有问题,可能会发生此问题:

  1. hbase-site.xml中的配置问题:在您选择的编辑器中打开hbase-site.xml,并确保正确设置以下属性(假设您设置了HDFS并创建了/ hbase目录在那里),
  2. &#13;
    &#13;
    <configuration>
      <property>
        <name>hbase.rootdir</name>
        <value>hdfs://localhost:9000/hbase</value>
      </property>
      <property>
        <name>hbase.zookeeper.property.clientPort</name>
        <value>2182</value>
      </property>
      <property>
        <name>hbase.zookeeper.property.dataDir</name>
        <value>/usr/local/var/zookeeper</value>
      </property>
      <property>
        <name>hbase.master</name>
        <value>localhost:60000</value>
        <description>The host and port that the HBase master runs at.</description>
      </property>
    </configuration>
    &#13;
    &#13;
    &#13;

    如果您使用本地目录作为hbase.rootdir,请将hdfs:// localhost:9000 / hbase替换为file:/// $ {hbase.rootdir}。

    1. hbase-env.sh中的配置问题:在您选择的文本编辑器中打开hbase-env.sh并从

      中删除#tag

      导出HBASE_MANAGES_ZK = true

    2. Zookeeper服务器未启动:转到zookeeper目录并在终端执行以下命令启动zookeeper,

      bin / zkServer start

    3. 最后,完成更新这些配置后重启hbase。

答案 1 :(得分:1)

首先手动启动Zookeeper:

cd /usr/lib/zookeeper/zookeeper-3.3.6
bin/zkServer.sh start   

然后开始Hbase

start-hbase.sh  

在此之前,您必须为Zookeeper文件夹提供必要的权限。

答案 2 :(得分:1)

我有同样的问题,这是我的决议:

首先你需要启动你的habse服务器,然后你可以启动你的hbase shell。

leiline@master:/usr/local/hbase/hbase-1.2.6/bin$ sh start-hbase.sh

leiline@master:/usr/local/hbase/hbase-1.2.6/bin$ hbase shell