1. 程式人生 > >hbase multiple SLF4J bindings 警告

hbase multiple SLF4J bindings 警告

2012-06-01

hbase shell 和命令操作中經常有個煩人的警告,說SLF4J有多個繫結:

hbase(main):003:0> list
TABLE
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/zhouhh/hbase-0.94.0/lib/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/zhouhh/hadoop-1.0.3/lib/slf4j-log4j12-1.4.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
t1
1 row(s) in 0.4300 seconds

檢視一下classpath,果然,hadoop和hbase各有一個jar檔案:

[[email protected] test]$ hbase classpath | tr ":" "n" | grep -i slf4j
/home/zhouhh/hbase-0.94.0/lib/slf4j-api-1.5.8.jar
/home/zhouhh/hbase-0.94.0/lib/slf4j-log4j12-1.5.8.jar
/home/zhouhh/hadoop-1.0.3/libexec/../lib/slf4j-api-1.4.3.jar
/home/zhouhh/hadoop-1.0.3/libexec/../lib/slf4j-log4j12-1.4.3.jar

解決辦法,將一個hbase lib下的jar移除,警告消除。(不能將hadoop lib下的jar檔案移除,否則呼叫shell 指令碼start-all.sh遠端啟動hadoop時會報找不到log4j包的錯誤。)

[[email protected] test]$ cd /home/zhouhh/hbase-0.94.0/lib/
 [[email protected] lib]$ mv slf4j-log4j12-1.5.8.jar ../.




hbase(main):001:0> list
TABLE
t1
1 row(s) in 0.4300 seconds

如非註明轉載, 均為原創. 本站遵循

知識共享CC協議,轉載請註明來源