HBASE使用详解


目录
  • HBASE 安装启动
  • 故障分析

HBASE 安装启动

vim hbase-site.xml


开启伪分布式
 
    hbase.cluster.distributed
    true
  
设置HBASE 数据的存储地址,必须修改之前默认是存储的本地盘

  hbase.rootdir
  hdfs://172.24.xx.xx:9000/hbase


  hbase.unsafe.stream.capability.enforce
  false

ZK的地址,HBASE会将元数据存储在ZK 上

        hbase.zookeeper.quorum
        localhost
    

先停止 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'