从官方下载的Hadoop 2.2.0发布包,安装配置启动后在日志信息中看到如下告警:
WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform… using builtin-java classes where applicable
这是因为:我们从官方下载的Hadoop发布包中native library的版本都是32位的,如果要支持64位,必须自己重新编译(搞不懂官网为啥默认是32位,目前基本上我们的OS都是运行在64位,更不用说生产环境)。
其实YARN的官方文档中有说明:”The pre-built 32-bit i386-Linux native hadoop library is available as part of the hadoop distribution and is located in the lib/native directory. You can download the hadoop distribution from Hadoop Common Releases.”
详细参加官方文档:http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/NativeLibraries.html
下面我们只需要 checkout 源码,然后在64位系统上重新编译生成相应的lib库替换即可:
1 2 3 4 5 6 |
#checkout 源码 svn co https://svn.apache.org/repos/asf/hadoop/common/tags/release-2.2.0/ # 切换目录 cd release-2.2.0 #编译 mvn clean package -Pdist,native -DskipTests -Dtar |
有关源码编译的配置可以参见: http://www.micmiu.com/opensource/hadoop/hadoop-build-source-2-2-0/
—————– EOF @Michael Sun —————–
0 条评论。