apache Hbase2.x 使用hbck2修复工具
1、背景
默认情况下apache hbase 使用hbck2时,无法使用-j 来加载hbck2的jar包,无法进行修复

2、解决办法
是由于默认情况下只使用自带的hbase hbck修复命令,大部分功能在2.x版本无法使用。需要在hbase的脚本中添加以下信息
# Look for the -j /path/to/HBCK2.jar parameter. Else pass through to hbck.
case "${1}" in
-j)
# Found -j parameter. Add arg to CLASSPATH and set CLASS to HBCK2.
shift
JAR="${1}"
if [ ! -f "${JAR}" ]; then
echo "${JAR} file not found!"
echo "Usage: hbase [<options>] hbck -jar /path/to/HBCK2.jar [<args>]"
exit 1
fi
CLASSPATH="${JAR}:${CLASSPATH}";
CLASS="org.apache.hbase.HBCK2"
shift # past argument=value
;;
*)
CLASS='org.apache.hadoop.hbase.util.HBaseFsck'
;;
esac
这样就可以使用-j来加载hbck2的jar包
hbck2下载地址:https://hbase.apache.org/downloads.html

hbck2使用参考
https://zhuanlan.zhihu.com/p/373957937






