因为Hadoop2在官网上预编译的包都是在32位下编译的,在64位系统上可能运行出问题,所以需要在64位系统上编译运行。
例如:http://apache.osuosl.org/hadoop/common/hadoop-2.2.0/
下载 hadoop-2.2.0-src.tar.gz
解压后运行:
- $ mvn -version
- $ mvn clean
- $ mvn install -DskipTests
- $ mvn compile -DskipTests
- $ mvn package -DskipTests
- $ mvn package -Pdist -DskipTests -Dtar 但是在运行过程中出现如下问题: Building Hadoop cannot access org.mortbay.component.AbstractLifeCycle error or class file for org.mortbay.component.AbstractLifeCycle not found 解决办法: https://issues.apache.org/jira/browse/HADOOP-10110 就是修改 hadoop-common-project/hadoop-auth/pom.xml 文件如下: https://issues.apache.org/jira/secure/attachment/12614482/HADOOP-10110.patch