Hadoop2.2作为release不支持Linux的64位版本,需要自己手工编译。下面是我自己的安装过程:
1. 复制一个虚拟机。
2. 下载hadoop-2.2.0-src.tar.gz解压缩,并且拷贝到Ubuntu的/opt文件夹下:
sujx@ubuntu:/opt$ cp -r /mnt/hgfs/F/hadoop/soft/hadoop-2.2.0-src ./
3. 下载protobuf-2.5.0.zip并且解压缩后拷贝到/opt目录下,而后编译
安装依赖包:
sudo apt-get install g autoconf automake libtool cmake zlib1g-dev pkg-config libssl-dev
编译protobuf
4. 修改hadoop2.2 BUG
目前的2.2.0 的Source Code 压缩包解压出来的code有个bug 需要patch后才能编译。否则编译hadoop-auth 会提示下面错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:testCompile (default-testCompile) on project hadoop-auth: Compilation failure: Compilation failure:
[ERROR] /home/chuan/trunk/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java:[84,13] cannot access org.mortbay.component.AbstractLifeCycle
[ERROR] class file for org.mortbay.component.AbstractLifeCycle not found
处理方式:https://issues.apache.org/jira/browse/HADOOP-10110
5. 正式编译:
mvn clean package -Pdist,native -DskipTests -Dtar
6. 编译后的文件位置:/opt/hadoop-2.2.0-src/hadoop-dist/target
把 hadoop-2.2.0拷贝到/opt文件夹下就可以正常使用。