且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Hadoop“无法为您的平台加载原生Hadoop库”警告

更新时间:2023-09-30 13:17:46

我假设您在64位CentOS上运行Hadoop。您看到该警告的原因是本地Hadoop库 $ HADOOP_HOME / lib / native / libhadoop.so.1.0.0 实际上是在32位上编译的。无论如何,这只是一个警告,并不会影响Hadoop的功能。



这里是if您希望消除此警告,请下载Hadoop的源代码并在64位系统上重新编译 libhadoop.so.1.0.0 ,然后替换32位版本。

有关如何重新编译源代码的步骤,请参阅Ubuntu:



祝你好运。

I'm currently configuring hadoop on a server running CentOs. When I run start-dfs.sh or stop-dfs.sh, I get the following error:

WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

I'm running Hadoop 2.2.0.

Doing a search online brought up this link: http://balanceandbreath.blogspot.ca/2013/01/utilnativecodeloader-unable-to-load.html

However, the contents of /native/ directory on hadoop 2.x appear to be different so I am not sure what to do.

I've also added these two environment variables in hadoop-env.sh:

export HADOOP_OPTS="$HADOOP_OPTS -Djava.library.path=/usr/local/hadoop/lib/"

export HADOOP_COMMON_LIB_NATIVE_DIR="/usr/local/hadoop/lib/native/"

Any ideas?

I assume you're running Hadoop on 64bit CentOS. The reason you saw that warning is the native Hadoop library $HADOOP_HOME/lib/native/libhadoop.so.1.0.0 was actually compiled on 32 bit.

Anyway, it's just a warning, and won't impact Hadoop's functionalities.

Here is the way if you do want to eliminate this warning, download the source code of Hadoop and recompile libhadoop.so.1.0.0 on 64bit system, then replace the 32bit one.

Steps on how to recompile source code are included here for Ubuntu:

Good luck.