java 无法连接到zookeeper然后hbase master关闭

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12607349/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 09:32:11  来源:igfitidea点击:

Can't connect to zookeeper and then hbase master shuts down

javahbaseapache-zookeeper

提问by raff0z

I use hbase 0.94.1 and zookeeper 3.3.6 after few attempts, the master of hbase shuts down and the sw exits

几次尝试后我使用hbase 0.94.1和zookeeper 3.3.6,hbase的master关闭并且sw退出

Those are the errors that I get from the shell

这些是我从 shell 得到的错误

12/09/26 18:58:35 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
12/09/26 18:58:35 INFO zookeeper.ClientCnxn: Opening socket connection to server /127.0.0.1:2181
12/09/26 18:58:35 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 5133@xxx-xxx
12/09/26 18:58:35 INFO zookeeper.ClientCnxn: Socket connection established to localhost/127.0.0.1:2181, initiating session
12/09/26 18:58:35 WARN zookeeper.ClientCnxnSocket: Connected to an old server; r-o mode will be unavailable
12/09/26 18:58:35 INFO zookeeper.ClientCnxn: Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x13a037edbb2000c, negotiated timeout = 40000
12/09/26 18:58:36 ERROR client.HConnectionManager$HConnectionImplementation: Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master.
12/09/26 18:58:36 INFO client.HConnectionManager$HConnectionImplementation: Closed zookeeper sessionid=0x13a037edbb2000c
12/09/26 18:58:36 INFO zookeeper.ZooKeeper: Session: 0x13a037edbb2000c closed
12/09/26 18:58:36 INFO zookeeper.ClientCnxn: EventThread shut down

org.apache.hadoop.hbase.MasterNotRunningException: Retried 10 times
    at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:127)
    at util.HBaseHelper.<init>(HBaseHelper.java:29)
    at util.HBaseHelper.getHelper(HBaseHelper.java:33)
    at driver.ABoxHbaseTableMaker.makeTable(ABoxHbaseTableMaker.java:39)
    at driver.ABoxImporterDriver.run(ABoxImporterDriver.java:55)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
    at driver.ABoxImporterDriver.main(ABoxImporterDriver.java:32)
    at gui.Main.jButton1ActionPerformed(Main.java:274)
    at gui.Main.access(Main.java:241)
    at gui.Main.actionPerformed(Main.java:160)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    ...

T tried to change the port but nothing.

T 试图更改端口但没有。

Those are the config files:

这些是配置文件:

zoo.cfg:

动物园.cfg:

tickTime=2000
dataDir=/home/.../.../zookeeper-3.3.6/data
clientPort=2181

hbase-site.xml

hbase-site.xml

<configuration>
<property>
    <name>hbase.rootdir</name>
    <value>file:///home/.../.../hbase-0.94.1/hbDATA/</value>
  </property>
 <property>
    <name>hbase.zookeeper.quorum</name>
    <value>localhost</value>
 </property>
 <property>
    <name>zookeeper.znode.parent</name>
    <value>file:///home/.../.../hbase-0.94.1/hbDATA/</value>
 </property>
 <property>
    <name>hbase.zookeeper.property.clientPort</name>
    <value>2181</value>
 </property>
</configuration>

回答by Tariq

If you are using HBase in standalone mode, you don't even need all these properties..Although, a pseudo or a fully distributed mode required additional settings..By looking at your config props, I am assuming you are using HBase in local mode.So you can skip all those things. And for a pseudo distributed mode HBase's default ZK is sufficient.

如果您在独立模式下使用 HBase,您甚至不需要所有这些属性..虽然,伪或完全分布式模式需要额外的设置..通过查看您的配置道具,我假设您在本地使用 HBase模式。所以你可以跳过所有这些事情。而对于伪分布式模式,HBase 的默认 ZK 就足够了。