HBase安装之后版本的验证的bug:(错误的替换、不到或⽆
法加载主类、SLF4J)
问题描述:
验证Hbase是否安装成功时爆出⼀⼤堆信息:
/usr/local/hadoop/libexec/hadoop-functions.sh: ⾏ 2360: HADOOP_ORG.APACHE.HADOOP.HBASE.UTIL.GETJAVAPROPERTY_USER:错误的替换
/usr/local/hadoop/libexec/hadoop-functions.sh: ⾏ 2455: HADOOP_ORG.APACHE.HADOOP.HBASE.UTIL.GETJAVAPROPERTY_OPTS:错误的替换
错误: 不到或⽆法加载主类 org.apache.hadoop.hbase.util.GetJavaProperty
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hbase/lib/client-facing-thirdparty/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See /codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
HBase 2.2.2
Source code repository git://6ad68c41b902/opt/hbase-rm/output/hbase revision=e6513a76c91cceda95dad7af246ac81d46fa2589
Compiled by hbase-rm on Sat Oct 19 10:10:12 UTC 2019
From source with checksum 4d23f97701e395c5d34db1882ac5021b
解决⽅式⼀:修改 hbase-env.sh ⽂件(hbase-env.sh 在 hbase 安装⽬录下的
/usr/local/hbase/conf ⽬录下)
将hbase-env.sh ⽂件最后⼀句:前⾯的注释去掉。(先到该⽬录,然后右键该⽬录,⽤vim打开)
解决⽅式⼆:如果问题还没有得到解决:例如还有⼀些问题:
(1)“不到或⽆法加载主类”的问题:org.apach.hadoop.habase.util.GetJavaProperty
/usr/local/hadoop/bin../libexec/hadoop-functions.sh⾏HADOOP._ORG.APACHE.HADOOP.HBASE.UTIL.GETJAVAPROPERTY_USER:错误的替换。
解决:修改hbase安装⽬录下 /bin/⽬录下的hbase⽂件:(先到该⽬录,然后右键该⽬录,⽤vim打开)
①在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"
②将以下代码注释掉:
#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
③在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}" \
然后保存并退出。
(2)SLF4J 的问题:Class path contains multiple SLF4J bindings.
原因:路径中含有冲突的jar包,如下图所⽰,⼀个在hbase路径下另⼀个在hadoop路径下。
解决:将HBase 或 Hadoop ⽬录下的 slf4j-logj12-1.7.25.jar,其中⼀个改⼀下,
例如修改 HBase⽬录下的 slf4j-logj12-1.7.25.jar 为:slf4j-logj12-1.7.25.jar-copy (右键搜索到的⽂件 -》重命名)
log4j2版本
(3)现在还有问题:HADOOP_ORG.APACHE.HADOOP.HBASE.UTIL.GETJAVAPROPERTY_USER: 错误的替换
解决:直接忽视
参考⽂章:
《Hbase 出现:/usr/local/hadoop/libexec/hadoop-functions.sh: ⾏ 2360: HADOOP_ORG.APACHE.HADOOP.HBASE.UTIL.》
《启动HBase时提⽰SLF4J: Class path contains multiple SLF4J bindings的解决⽅法》
《centos7下hbase配置及解决错误: 不到或⽆法加载主类 org.apache.hadoop.hbase.util.GetJavaProperty等三个问题》Processing math: 100%

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。