编译Hadoop2.5.2

环境:CentOS6.6 64bit 、JDK1.7.0_72

一、安装与编译有关的包
[root@hadoop4 ~]# yum install autoconfautomake libtool cmake ncurses-devel openssl-devel gcc*

二、安装Maven
[grid@hadoop4 ~]$ wget http://apache.fayea.com/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz
[grid@hadoop4 ~]$ tar -zxvf ./apache-maven-3.2.5-bin.tar.gz
[root@hadoop4 grid]# mv apache-maven-3.2.5 /usr/local
设置环境变量
[grid@hadoop4 ~]$ vi .bash_profile
# User specific environment and startup programs
PATH=$PATH:$HOME/bin:/usr/local/apache-maven-3.2.5/bin
JAVA_HOME=/usr/java/jdk1.7.0_72
export JAVA_HOME
export PATH
[grid@hadoop4 ~]$ source .bash_profile
验证环境变量是否生效
[grid@hadoop4 ~]$ env

三、安装protobuf
[root@hadoop4 grid]# wget https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz
[root@hadoop4 grid]# tar zxvf protobuf-2.5.0.tar.gz
[root@hadoop4 grid]# cd protobuf-2.5.0
[root@hadoop4 protobuf-2.5.0]# ./configure
[root@hadoop4 protobuf-2.5.0]# make
[root@hadoop4 protobuf-2.5.0]# make check
[root@hadoop4 protobuf-2.5.0]# make install
安装完后的成果:
[root@hadoop4 protobuf-2.5.0]# ls /usr/local/bin
protoc

四、获取Hadoop源码
[root@hadoop4 grid]# wget http://mirrors.hust.edu.cn/apache/hadoop/common/hadoop-2.5.2/hadoop-2.5.2-src.tar.gz
[root@hadoop4 grid]# tar -zxvf hadoop-2.5.2-src.tar.gz
[root@hadoop4 grid]# chown -R grid hadoop-2.5.2-src

五、编译
[grid@hadoop4 hadoop-2.5.2-src]$ mvn package -Pdist,native -DskipTests -Dtar
编译时间很长,编译完成后会有清单显示,当显示的每一项都是SUCCESS时,则编译成功。
编译Hadoop2.5.2_第1张图片
编译后的成果:
编译Hadoop2.5.2_第2张图片
编译Hadoop2.5.2_第3张图片

你可能感兴趣的:(编译Hadoop2.5.2)