Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hadoop: Unable to load native-hadoop library for your platform

Tags:

java

hadoop

I've installed Hadoop 2.7.2 single node on Ubuntu and I want to run the java wordcount program. The compilation and the creation of the jar file are done succesfully, but when I run the jar file on Hadoop I receive this message:

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

I set environment variables by editing .bashrc file:

export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib

When I type hadoop checknative -a I get this:

hadoop: true /usr/local/hadoop/lib/native/libhadoop.so.1.0.0
zlib: true /lib/x86_64-linux-gnu/libz.so.1
snappy: false 
lz4: true revision:99
bzip2: false
openssl: true /usr/lib/x86_64-linux-gnu/libcrypto.so

16/05/09 00:48:53 INFO util.ExitUtil: Exiting with status 1

Hadoop version: 2.7.2

Ubuntu version: 14.04

Could anyone give some clues about the issue?

like image 541
El Mehdi Belgasmi Avatar asked May 08 '16 09:05

El Mehdi Belgasmi


2 Answers

Move your compiled native library files to $HADOOP_HOME/lib folder.

Then set your environment variables by editing .bashrc file

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

Make sure your compiled native library files are in $HADOOP_HOME/lib folder.

It should fix the issue.

like image 161
Nishu Tayal Avatar answered Oct 15 '22 09:10

Nishu Tayal


Add the commands lines below to hadoop-env.sh, it should suppress the errors encountered

export HADOOP_HOME_WARN_SUPPRESS=1
export HADOOP_ROOT_LOGGER="WARN,DRFA"
like image 31
Mike Onuorah Avatar answered Oct 15 '22 11:10

Mike Onuorah