首页 > 技术文章 > HBASE使用详解

yyystar 2021-11-30 14:29 原文

HBASE 安装启动

vim hbase-site.xml

<configuration>
开启伪分布式
 <property>
    <name>hbase.cluster.distributed</name>
    <value>true</value>
  </property>
设置HBASE 数据的存储地址,必须修改之前默认是存储的本地盘
<property>
  <name>hbase.rootdir</name>
  <value>hdfs://172.24.xx.xx:9000/hbase</value>
</property>
<property>
  <name>hbase.unsafe.stream.capability.enforce</name>
  <value>false</value>
</property>
ZK的地址,HBASE会将元数据存储在ZK 上
<property>
        <name>hbase.zookeeper.quorum</name>
        <value>localhost</value>
    </property>
</configuration>

先停止 HBASE服务 bin/stop-hbase.sh
JPS 正常启动进程包括 HMaster HRegionServer

再重启HBASE服务 bin/start-hbase.sh

故障分析

ServerCrashProcedures=false. Master startup cannot progress, in holding-pattern until region onlined.
master.HMaster: Master failed to complete initialization after 900000ms. Please consider submitting a bug report including a thread dump of this process.
陆陆续续报上述错误,原因是新制作的HBASE和老版本不兼容解决手段如下:
登录到 ZK shell客户端 rmr /hbase/meta-region-server 删除该元数据,重启HBASE 就解决了上述问题

bin/hbase shell
create 't1','cf'
list 't1'
describe 't1'
put 't1', 'row1', 'cf:a', 'value1'
put 't1', 'row2', 'cf:b', 'value2'
scan 't1'

get 't1','row1'

disable 't1'
enable 't1'

drop 't1'

推荐阅读