HBase 0.92 关于 SLF4J 绑定的警告
我在 Hadoop 1.0.0 上安装了 HBase 0.92,它在完全分布式模式下工作正常,但不断出现烦人的警告。我怎样才能摆脱它?
.......
hbase(main):001:0> status
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in
[jar:file:/opt/hbase-0.92.0/lib/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in
[jar:file:/opt/hadoop-1.0.0/lib/slf4j-log4j12-1.4.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
: See http://www.slf4j.org/codes.html#multiple_bindings for an
explanation.
3 servers, 0 dead, 0.6667 average load
.......
PS我没有在hbase-env.sh
中设置$CLASSPATH
变量。我使用 start-all.sh
运行 Hadoop,然后使用 start-hbase.sh
启动 HBase。
I installed HBase 0.92
on Hadoop 1.0.0
and it works fine in full-distributed mode, but an annoying warning keeps appearing. How can I get rid of it?
.......
hbase(main):001:0> status
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in
[jar:file:/opt/hbase-0.92.0/lib/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in
[jar:file:/opt/hadoop-1.0.0/lib/slf4j-log4j12-1.4.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
: See http://www.slf4j.org/codes.html#multiple_bindings for an
explanation.
3 servers, 0 dead, 0.6667 average load
.......
P.S. I did not set the $CLASSPATH
variable in hbase-env.sh
. I run Hadoop with start-all.sh
, then start HBase with start-hbase.sh
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我删除了
${hase}/lib/
中的slf4j-log4j12-1.5.8.jar
然后警告再也没有显示。应该是由于加载了重复的类,hadoop
和hbase
在同一个jvm
中使用相同的jar
。你可以尝试一下。
I removed the
slf4j-log4j12-1.5.8.jar
in${hase}/lib/
then the warning never shown again. It should be due to a duplicated class loaded, bothhadoop
andhbase
use the samejar
in the samejvm
.You can give it a try.
SLF4J 发出的警告只是一个警告。即使存在多个绑定,SLF4J 也会选择一个日志框架/实现并与其绑定。 SLF4J 选择绑定的方式由 JVM 决定,并且出于所有实际目的,应将其视为随机的。从版本 1.6.6 开始,SLF4J 将命名它实际绑定到的框架/实现类。
嵌入式组件(例如库或框架)不应声明对任何 SLF4J 绑定的依赖,而仅依赖于 slf4j-api。当库声明对 SLF4J 绑定的编译时依赖项时,它会将该绑定强加给最终用户,从而否定了 SLF4J 的目的。当您遇到嵌入式组件声明对任何 SLF4J 绑定的编译时依赖项时,请花点时间联系所述组件/库的作者,并恳请他们改正他们的方式。
The warning emitted by SLF4J is just that, a warning. Even when multiple bindings are present, SLF4J will pick one logging framework/implementation and bind with it. The way SLF4J picks a binding is determined by the JVM and for all practical purposes should be considered random. As of version 1.6.6, SLF4J will name the framework/implementation class it is actually bound to.
Embedded components such as libraries or frameworks should not declare a dependency on any SLF4J binding but only depend on slf4j-api. When a library declares a compile-time dependency on a SLF4J binding, it imposes that binding on the end-user, thus negating SLF4J's purpose. When you come across an embedded component declaring a compile-time dependency on any SLF4J binding, please take the time to contact the authors of said component/library and kindly ask them to mend their ways.