HBase 安装之后版本的验证的bug:(错误的替换、找不到或无法加载主类、SLF4J)
/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.HBA
·
问题描述:
验证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 http://www.slf4j.org/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
对于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 (右键搜索到的文件 -》 重命名)
对于找不到或无法加载主类 org.apache.hadoop.hbase.util.GetJavaProperty
我们需要改一下hbase/bin/目录下的hbase文件
cd /usr/local/hbase/bin
vim hbase
切到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}" \
然后wq保存退出,重启一下hbase,就可以了。
更多推荐
已为社区贡献7条内容
所有评论(0)