Zookeeper 无法在 hbase 伪分布式模式下定位主节点

Zookeeper not able to locate master node in hbase pseudo distributed mode

我想运行伪分布式hbase,从头开始安装
接下来的步骤

  1. 启动 HBase。
  2. 启动 HBase 主服务器
  3. 启动区域服务器a
  4. 启动 HBaseShell
  5. 执行列表

Hbase 正常启动所以 hbase shell。 当我检查 zookeeper、master 以及区域时,所有服务器都已启动。 对于 hbase shell 提示的任何查询,我收到此错误。

Error - Can't get master address from ZooKeeper; znode data == null

code- configuration -
                hbase-site.xml 
                <configuration>
                   <property>
                      <name>hbase.cluster.distributed</name>
                      <value>true</value>
                   </property>
                   //Here you have to set the path where you want HBase to store its files.
                   <property>
                      <name>hbase.rootdir</name>
                      <value>hdfs://localhost:8030/hbase</value>
                   </property>
                   <property>
                      <name>hbase.zookeeper.property.dataDir</name>
                      <value>/home/hadoop/zookeeper</value>
                   </property>
                </configuration>

以上是我的hbase-site.xml配置。
请帮助我了解我所缺少的。

您还需要在 hbase-site.xml 中设置此 属性:

hbase.zookeeper.quorum

需要将以下属性添加到 /hbase/conf 文件夹中的 hbase xml 文件中:

<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2222</value>
<description>Property from ZooKeeper's config zoo.cfg.
The port at which the clients will connect.
</description>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/home/biadmin/my-local-hbase/zookeeper</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>bivm</value>
</property>

同时编辑 hbase-env.sh 文件。添加正确的 JAVA_HOME 路径并取消注释

export HBASE_MANAGES_ZK=true

这应该可以解决上述错误!