Unable to load native-hadoop library
The reason for this warning is that apache hadoop2.7 needs to use glibc of 2.1.4 and the lib of our cloud host operating system is 2.1.2:
WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform… using builtin-java classes where applicable
1.
# ll /lib64/libc.so.6 //View the current system glibc version
$ export HADOOP_ROOT_LOGGER=DEBUG,console
hadoop fs -ls /
This matter will output debug information, see the warning to find out the glibc version required by hadoop
2. Download the corresponding version of glibc to install
Download the address and find the corresponding version of glibc
http://ftp.gnu.org/gnu/glibc/
[root@node1 ~]# export CFLAGS="-g -O2"
[root@node1 ~]# ./glibc-2.14.1/configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
[root@node1 ~]# make
[root@node1 ~]# make install
In this case, try the hadoop command again, and no error is reported.
[hadoop@node1 hadoop-2.7.0]$ bin/hadoop fs -ls /
Found 1 items
drwxr-xr-x - hadoop supergroup 0 2015-05-21 09:12 /home
Find the easy way:
wget http://dl.bintray.com/sequenceiq/sequenceiq-bin/hadoop-native-64-2.7.0.tar
Unzip to hadoop-2.7.0/lib/native/