TL; DR:为什么HBase管理的Zookeeper无法启动?
我正在尝试设置一个HBase集群,从头开始学习HBase。我有4个运行Ubuntu 14.04 LTS Server的Virtualbox VM。我安装了Hadoop(2.7.3),其中包含一个主节点和3个工作节点。它们每个都有2个以太网适配器,1个处于NAT模式,1个处于仅主机网络模式(每个Virtualbox)。它们是192.168.56.50(主)和192.168.56.51-53(工人)。
当我安装HBase 1.2.4时,我尝试在HBase管理的所有3个工作节点上使用Zookeeper仲裁进行设置。这不会运行。我试图擦除所有工作节点上的Zookeeper数据文件夹,然后将hbase-site.xml中的zookeeper配置减少到第一个worker上的单节点仲裁,但它仍然无效。
在hbase-env.sh我有
export HBASE_MANAGES_ZK=true
在hbase-site.xml中我有
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>192.168.56.51</value>
</property>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/usr/local/zookeeper/data</value>
</property>
<property>
<name>zookeeper.znode.parent</name>
<value>/hbase-unsecure</value>
</property>
在主服务器上,在master.log文件中,我得到了
"ERROR [main] client.ConnectionManager$HConnectionImplementation: The node /hbase is not in ZooKeeper. It should have been written by the master. Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master."
在master.log中我得到了
"RpcRetryingCaller{globalStartTime=1484535638771, pause=100, retries=1}, org.apache.hadoop.hbase.MasterNotRunningException: org.apache.hadoop.hbase.MasterNotRunningException: The node /hbase is not in ZooKeeper. It should have been written by the master. Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master."
和很多
2017-01-15 21:59:11,236 INFO [main-SendThread(192.168.56.51:2181)] zookeeper.ClientCnxn: Opening socket connection to server 192.168.56.51/192.168.56.51:2181. Will not attempt to authenticate using SASL (unknown error)
2017-01-15 21:59:11,237 WARN [main-SendThread(192.168.56.51:2181)] 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:744)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
接着是
2017-01-15 21:59:26,761 ERROR [main] zookeeper.RecoverableZooKeeper: ZooKeeper create failed after 4 attempts
2017-01-15 21:59:26,761 ERROR [main] master.HMasterCommandLine: Master exiting
java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMaster.
at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:2426)
at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:231)
at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:137)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:126)
at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:2436)
在应该是唯一Zookeeper节点的节点上,zookeeper.out文件为空,zookeeper.log文件包含大量
[main-SendThread(192.168.56.51:2181)] zookeeper.ClientCnxn: Opening socket connection to server 192.168.56.51/192.168.56.51:2181. Will not attempt to authenticate using SASL (unknown error)
2017-01-17 21:50:32,343 WARN [main-SendThread(192.168.56.51:2181)] 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:744)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
为什么会失败?对于出了什么问题,我找不到任何好的解释。