环境
[root@vm8028 soft]# cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m [root@vm8028 soft]# uname -a
Linux vm8028 2.6.-.el6.x86_64 # SMP Fri Nov :: UTC x86_64 x86_64 x86_64 GNU/Linux
[root@vm8028 soft]# hadoop version
Hadoop 2.7.
Subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r 15ecc87ccf4a0228f35af08fc56de536e6ce657a
Compiled by jenkins on --29T06:04Z
Compiled with protoc 2.5.
From source with checksum fc0a1a23fc1868e4d5ee7fa2b28a58a
This command was run using /usr/local/hadoop-2.7./share/hadoop/common/hadoop-common-2.7..jar
问题 ,安装完Hadoop之后操作总报这样的警告,但是不影响使用
[WARN ] 2018-04-18 18:07:39,897 method:org.apache.hadoop.util.NativeCodeLoader.<clinit>(NativeCodeLoader.java:62)
Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
root@vm8028 ~]# hadoop fs -ls /
[WARN ] -- ::, method:org.apache.hadoop.util.NativeCodeLoader.<clinit>(NativeCodeLoader.java:)
Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Found items
drwxr-xr-x - root supergroup -- : /park
drwxr-xr-x - root supergroup -- : /user
问题原因:
因为Apache 提供的Hadoop的native库 是32位的,我们的操作系统是64位的,所以需要使用64位操作系统编译。或者下载编译好的64位本地包
这里提供一个下载地址 http://dl.bintray.com/sequenceiq/sequenceiq-bin/
因为没有找到2.7.1版本, (使用hadoop-native-64.tar 不行) 下载了hadoop-native-64-2.7.0.tar 替换本地库
[root@vm8028 soft]# tar -xvf hadoop-native--2.7..tar -C hadoop-native--2.7. [root@vm8028 lib]# mv /home/soft/hadoop-native--2.7. ./ [root@vm8028 lib]# mv hadoop-native--2.7. native [root@vm8028 lib]# chown -R hadoop.hadoop native
重启Hadoop后问题解决
[root@vm8028 ~]# hadoop fs -ls /
Found items
drwxr-xr-x - root supergroup -- : /park
drwxr-xr-x - root supergroup -- : /user