java - 无法加载类 org.slf4j.impl.StaticLoggerBinder 和无法加载 native hadoop 库

标签 java hadoop

我是 Hadoop 的新手,在一次 MapReduce 任务中我遇到了以下错误:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation 
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
15/09/18 07:31:10 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

我该如何解决这个问题?

谢谢!

最佳答案

以下是您的错误的含义:

对于SLF4J:

SLF4J: **Failed to load class** "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation 
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

如您所知,您没有适当的类(*无法加载类*)让 SLF4J 正常工作,因此它默认为无日志记录((NOP) 记录器实现)。按照建议link您可以看到解决方案是:

Placing one (and only one) of slf4j-nop.jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar on the class path should solve the problem

对于 Hadoop:

15/09/18 07:31:10 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

这只是找不到native library,一般不会影响Hadoop的运行方式。至于原生库:

The native library just contains implementations of certain components for performance reasons and for non-availability of Java implementations. These components are available in a single, dynamically-linked native library called the native hadoop library. On the *nix platforms the library is named libhadoop.so.

无论如何,如果您真的想要摆脱警告,您可以遵循提供的众多解决方案之一 here .

关于java - 无法加载类 org.slf4j.impl.StaticLoggerBinder 和无法加载 native hadoop 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32655157/

相关文章:

java - 线程 : Not calling run method

hadoop - 如何在hadoop 1.2.1中的默认fifo调度程序中进行更改?

java - 如何在类(class)中单独更新外观和感觉干净?

Java 级联枚举?

java - PDFBox - 删除不可见文本(通过剪辑/填充路径问题)

hadoop - 如何在Impala中查询数组元素?

hadoop - SparkSql 中的存储过程/函数

java - 如何在android中以编程方式更改编辑文本的位置?

hadoop - 在 HDFS Hadoop 的文件更改所有者期间获取文件 inode?

hadoop - HBase MR-键/值不匹配