1. 需要的软件
jdk / maven / protobuf / hadoop-2.2.0-src
2. 安装
(1)安装linux依赖: yum install gcc gcc-c++ make cmake openssl-devel ncurses-devel
(2)解压jdk / maven / protobuf / hadoop-2.2.0-src 这几个tar包
(3)安装protobuf
cd protobuf-2.5.0
./configure --prefix=/opt/protoc/
make && make install
(3)配置环境变量
export JAVA_HOME=/opt/binary/jdk1.7.0_60
export MAVEN_HOME=/opt/binary/apache-maven-3.2.1
export PROTOC_HOME=/opt/protoc
export PATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin:$PROTOC_HOME/bin
(5) 编译 hadoop
mvn package -Pdist,native -DskipTests -Dtar
常见问题:
1. hadoop-auth 编译的时候 报错: [ERROR] class file for org.mortbay.component.LifeCycle not found
解决办法:
hadoop-common-project/hadoop-auth/pom.xml文件,添加依赖:
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-util</artifactId>
<scope>test</scope>
</dependency>
如果有其它问题,欢迎你提问。