由于Hadoop 2.2.0默认配置的libhadoop是32位的,在64位的操作系统环境运行过程中,会提示以下错误:
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /opt/hadoop-2.2.0/lib/native/libhadoop.so.1.0.0 which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
13/11/01 10:58:59 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
需要重新编译Hadoop的代码,得到适合的库文件。按以下步骤执行。
下载Hadoop 2.2.0 源代码
可以从Apache官方下载Hadoop 2.2.0的源代码,或者在以下网址下载Hadoop 2.2.0的源代码:
http://mirrors.cnnic.cn/apache/hadoop/common/hadoop-2.2.0/hadoop-2.2.0-src.tar.gz
配置编译环境
本文采用的Ubuntu 12.04.3 LTS环境,先安装编译环境:
$ sudo apt-get install build-essential
$ sudo apt-get install g++ autoc