Hadoop “Unable to load native-hadoop library for your platform” warning

3.7K    Asked by BellaBlake in Big Data Hadoop , Asked on Apr 19, 2021

I installed Hadoop on the server running CentOs. As I run start-dfs.shor stop-dfs.sh I got the following error :

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

I am using the Hadoop 2.2.0 Version. In hadoop-env.sh I have also added these two environment variables.  

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

Getting the error “unable to load native hadoop library for your platform”.

Any solution what I have to do? 

Answered by Bella Blake

This error arises that “ unable to load native hadoop library for your platform” as the native library of Hadoop is built in for a 32 bit system, your system maybe 64 bit.

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

So, it is giving a warning but not much of Hadoop functionalities will be affected.You can ignore the warning or if you want to remove it then :

Either replace the 32 bit library by downloading Hadoop source code and recompiling it.

Or in hadoop-env.sh where you have added environment variables,

add the word NATIVE like this :

  export HADOOP_OPTS="$HADOOP_OPTS -Djava.library.path=$HADOOP_HOME/lib/native"

 Note:

There may be two possibilities: You have installed the wrong Java JDK8 package. Please ensure to download the 64-bit JDK8 and remove your current 32-bit JDK8. It's a warning due to the Hadoop libraries being compiled for 32bits.



Your Answer

Interviews

Parent Categories