HBase 0.92 关于 SLF4J 绑定的警告

发布于 2025-01-07 14:25:21 字数 722 浏览 1 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

好多鱼好多余 2025-01-14 14:25:21

我删除了 ${hase}/lib/ 中的 slf4j-log4j12-1.5.8.jar 然后警告再也没有显示。应该是由于加载了重复的类,hadoophbase 在同一个 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, both hadoop and hbase use the same jar in the same jvm.

You can give it a try.

肤浅与狂妄 2025-01-14 14:25:21

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文