If native libraries are not available the following message is displayed with every hadoop command: hadoop checknative
Clone hadoop source code
Checkout the version 2.7.1
source
WARN NativeCodeLoader:60 - Unable to load native-hadoop library for your platform. Using builtin-java classes where applicable I find this very strange, because I know for a fact it uses the same hadoop that I can start on my own without any warnings. There are no other hadoop installations on my computer.
Install required dependencies - OSX: use brew
or any other package manager
Build project and native dependencies with maven
Copy newly created libraries to the hadoop installation
Add shell variables either to the ~/.bash_profile
, or $HADOOP_INSTALL/etc/hadoop/hadoop-env.sh
Check if native libraries are available:
above rules do not cause bzip2 native libs to work in OSX. |
@zhutoulala -- FWIW your links worked for me with Hadoop 2.4.0 with one exception I had to tell maven not to build the javadocs. I also used the patch in the first link for 2.4.0 and it worked fine. Here's the maven command I had to issue
After building this and moving the libraries, don't forget to update hadoop-env.sh :)
Thought this might help someone who ran into the same roadblocks as me
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?
After a continuous research as suggested by KotiI got resolved the issue.
Cheers