标签:hadoop2.2.0 unable to load nativ 64 bit
最近在学习Hadoop(2.2.0),打算写一个MapReduce的小程序在Ubuntu 64位的环境下测试一把,一切环境配置完毕后,执行的过程中,控制台输出下面的内容:
WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
在网上搜索了一番,得出如下结论:
“The reason you saw that warning is the native Hadoop library$HADOOP_HOME/lib/native/libhadoop.so.1.0.0
was actually compiled on 32 bit.”
意思就是Hadoop 的native是在32 bit环境下编译的,在64bit环境下运行会有问题,所以需要下载hadoop 2.2.0 的源码在64bit环境下重新编译
要想解决这个问题需要重新编译hadoop2.2.0 的源码,步骤如下:
(1)配置依赖包:
apache-maven-3.0.5-bin.tar.gz (http://maven.apache.org/download.cgi)
findbugs-2.0.2.tar.gz (http://sourceforge.jp/projects/sfnet_findbugs/releases/)
protobuf-2.5.0.tar.gz (https://code.google.com/p/protobuf/downloads/list)
maven以及findbugs,只需要解压缩,然后在/etc/profile中配置即可,配置完之后不要忘记执行source /etc/profile
protobuf包解压缩后需要执行make动作,命令如下
cd protobuf-2.5.0/ ./configure --prefix=`pwd`/inst/bin && make && make install export PATH=`pwd`/inst/bin:$PATH
cd hadoop-2.2.0-src wget https://issues.apache.org/jira/secure/attachment/12614482/HADOOP-10110.patch patch -p0 < HADOOP-10110.patch(3)进行编译
mvn package -Pdist,native -DskipTests -Dtar
Hadoop 2.2.0 常见问题之:Ubuntu 64环境下“Unable to load native-hadoop library for your platform”问题”
标签:hadoop2.2.0 unable to load nativ 64 bit
原文地址:http://blog.csdn.net/eric_sunah/article/details/36729729