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

rjjhvcjd  于 2021-06-10  发布在  Hbase
关注(0)|答案(2)|浏览(293)

我想在伪分布式模式下运行hbase,安装是从头开始的。
接下来的步骤
启动hbase。
启动hbase主服务器
启动区域服务器a
启动hbase shell
执行列表
hbase正常启动,因此hbase shell。当我检查zookeeper,master和所有服务器都启动了。对于hbase shell提示符上的任何查询,我都会遇到此错误。
错误-无法从zookeeper获取主地址;znode数据==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 配置。
请帮助我理解我所缺少的。

mqxuamgl

mqxuamgl1#

需要将以下属性添加到/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文件。添加正确的javau主路径并取消注解

export HBASE_MANAGES_ZK=true

这将解决上述错误!

nuypyhwy

nuypyhwy2#

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

hbase.zookeeper.quorum

相关问题