Environment
OS: Ubuntu 12.04 LTS
Kernel Version: 3.8.0-33-generic
Hadoop: 2.2.0
Pre-Compile
官方的 BUILDING.txt 给出的安装需求
安装 JDK
1 | sudo apt-get install openjdk-7-jdk |
安装 Maven
1 | sudo apt-get install maven |
安装 Findbugs
Download: http://findbugs.sourceforge.net/
设置环境变量
1 | vi .bashrc |
安装 ProtocolBuffer
Download: https://code.google.com/p/protobuf/
在安装 protocolbuffer 之前需要先安装 g++
1 | sudo apt-get install g++ |
安装 protocolbuffer
1 | cd protobuf-2.5.0 |
安装 CMake
1 | sudo apt-get install cmake |
Compile
1 | mvn package -Pdist -DskipTests -Dtar |
编译后的结果可以在 hadoop-2.2.0-src/hadoop-dist/target/hadoop-2.2.0 中看到
常见问题
1) error: cannot access AbstractLifeCycle
在编译的过程中出现/home/killua/Workspace/hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/src/test/java/org/apache/hadoop/security/authentication/client/AuthenticatorTestCase.java:[88,11] error: cannot access AbstractLifeCycle 错误
经过查证发现是 hadoop2.2.0 的一个 bug,具体参见https://issues.apache.org/jira/browse/HADOOP-10110
解决方法:
修改 hadoop-2.2.0-src/hadoop-common-project/hadoop-auth/pom.xml,将
1 | <dependency> |
修为
1 | <dependency> |