1 . 安装与编译相关的包
yum install svn -yyum install autoconfautomake libtool cmake -yyum install ncurses-devel -yyum install openssl-devel -yyum install gcc* -y
2 . 安装maven
通过写好xml会简化繁琐的编译流程..
网址 http://maven.apache.org/
wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.2.3/binaries/apache-maven-3.2.3-bin.tar.gztar xf apache-maven-3.2.3-bin.tar.gzmv apache-maven-3.2.3 /usr/local/
设置环境变量:
vi .bash_profilePATH=$PATH:$HOME/bin:/usr/local/apache-maven-3.2.3/binJAVA_HOME=/usr/java/jdk1.7.0_67export JAVA_HOMEexport PATH
3. 安装protobuf
这是google的一个用于数据交换格式的..
下载地址: https://code.google.com/p/protobuf/downloads/list
wget https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gztar xf protobuf-2.5.0.tar.gzcd protobuf-2.5.0./configuremakemake installls -l /usr/local/bin/protoc
4. 获取hadoop程序源代码
svn地址: http://svn.apache.org/repos/asf/hadoop/common/tags/
svn checkout http://svn.apache.org/repos/asf/hadoop/common/tags/release-2.2.0/cd release-2.2.0mvn package -Pdist,native -DskipTests -Dtar
编译后的结果存在release-2.2.0/hadoop-dist/target
可以在release-2.2.0/hadoop-dist/target/hadoop-2.2.0/lib/native 找到编译好的本地库