分类
故障描述
客户安装flume执行flume-ng verion提示org.apache.hadoop.hbase.util.GetJavaProperty。hbase version也提示该错误。
故障分析
hbase bug,详见:https://reviews.apache.org/r/69299/diff/2/?expand=1
处理过程
进入hbase/bin目录
cp hbase.distro hbase.distro-bak //先备份原有文件
vi hbase.distro
切到182行,在add_to_cp_if_exists “${HBASE_HOME}/hbase-server/target” 这里下面加上两行
# Needed for GetJavaProperty check below add_to_cp_if_exists "${HBASE_HOME}/hbase-server/target/classes"
把下面大概186,187行的
#add the hbase jars for each module
for f in $HBASE_HOME/hbase-jars/hbase*.jar; do
if [[ $f = *sources.jar ]]
then
: # Skip sources.jar
elif [ -f $f ]
then
CLASSPATH=${CLASSPATH}:$f;
fi
done
这部分注释掉
切到大概310行左右,在
if [ -n "${HADOOP_IN_PATH}" ] && [ -f "${HADOOP_IN_PATH}" ]; then
下面加上一段:
# If built hbase, temporarily add hbase-server*.jar to classpath for GetJavaProperty # Exclude hbase-server*-tests.jar temporary_cp= for f in "${HBASE_HOME}"/lib/hbase-server*.jar; do if [[ ! "${f}" =~ ^.*\-tests\.jar$ ]]; then temporary_cp=":$f" fi done
然后把
HADOOP_JAVA_LIBRARY_PATH=$(HADOOP_CLASSPATH="$CLASSPATH" "${HADOOP_IN_PATH}" \ 改成
HADOOP_JAVA_LIBRARY_PATH=$(HADOOP_CLASSPATH="$CLASSPATH${temporary_cp}" "${HADOOP_IN_PATH}" \
即可。
详见附件文件
建议/总结
无