一、hbase出现的问题
1.元数据表hbase:namespace 不在线
导致查询数据时 master is initing
2.一些表的region一直处于opening状态
3.region is not online
二、修复工具编译
git地址
https://github.com/apache/hbase-operator-tools 下载到idea
我使用的hdp的3.1.78,hbase为2.0.2,这个工具就不支持这版本
2.0.2的 hbase-server 的Hbck里面是 没有assigns等其他的方法
我这边是使用了从git拉下来的版本(hbase 2.4.7)直接编译的,需要在pom文件里面修改一下依赖作用域
去掉scope的 provide 打一个 胖包(原因是我的集群版本的都没有这些方法,执行命令去找 hbase classpath的hbase-server相关的jar 绝对会报错)
编译好在target,上传到hbase的机器上
三、工具安装
执行hbase命令,看到hbase2版本 要运行的命令是这样
hbase hbck -j /opt/software/hbase-hbck2-1.2.0-SNAPSHOT.jar
按照HBCK2 的readme文件
为了方便我直接加入hbase的环境变量
hdp版本的hbase命令环境变量
vim /bin/hbase,加到class_path后面
执行 hbase classpath 查看一下有没有加进去
下一篇写hbase的这个运维工具用法