分享知识,分享快乐

0%

CDH-HBase 使用 HBCK2 运维

前言

周末 CDH6.3 的集群断电,导致 HBase 出现 RIT 状态。

赶紧把之前学的 hbck2 的知识实践顺便回顾下

过程

将项目拉取到本地 git clone https://github.com/apache/hbase-operator-tools.git --depth 1

编译出jar包上传到集群上 mvn clean package -Dmaven.skip.test=true

CDH 集群的话将其上传至/opt/cloudera/parcels/CDH/lib/hbase/lib路径下

使用

1
2
3
4
hbase org.apache.hbase.HBCK2 <命令>

# 验证是否可以使用
hbase org.apache.hbase.HBCK2 -v

结果当头一棒,不支持 2.1.0-cdh6.3.1

1
2
3
4
5
6
7
8
9
12:48:02.084 [main] INFO  org.apache.hadoop.hbase.client.ConnectionImplementation - Closing master protocol: MasterService
Exception in thread "main" java.lang.UnsupportedOperationException: bypass not supported on server version=2.1.0-cdh6.3.1; needs at least a server that matches or exceeds [2.0.3, 2.1.1, 2.2.0, 3.0.0]
at org.apache.hbase.HBCK2.checkHBCKSupport(HBCK2.java:134)
at org.apache.hbase.HBCK2.bypass(HBCK2.java:335)
at org.apache.hbase.HBCK2.doCommandLine(HBCK2.java:686)
at org.apache.hbase.HBCK2.run(HBCK2.java:631)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:90)
at org.apache.hbase.HBCK2.main(HBCK2.java:865)

版本不支持,翻阅文档使用-s跳过版本检查,即 hbase org.apache.hbase.HBCK2 -s

更多的命令参考可以参阅下方链接

其他

Region in transition 的信息是在 active hmater WEB UI 页面上查看,
如果没有RIT状态的 region,其不会显示,所以正常 HBase 集群是看不到 Region in transition 的内容