hadoop 2.2 本地库编译
时间:2014-12-02 15:39来源:linux.it.net.cn 作者:IT
1 . 安装与编译相关的包
1
2
3
4
5 |
yum install svn -y
yum install autoconfautomake libtool cmake -y
yum install ncurses-devel -y
yum install openssl-devel -y
yum install gcc* -y
|
2 . 安装maven通过写好xml会简化繁琐的编译流程..
网址 http://maven.apache.org/
1
2
3 |
wget http://mirrors.hust.edu.cn/apach ... en-3.2.3-bin.tar.gz
tar xf apache-maven-3.2.3-bin.tar.gz
mv apache-maven-3.2.3 /usr/local/
|
设置环境变量:
1
2
3
4
5 |
vi .bash_profile
PATH=$PATH:$HOME/bin:/usr/local/apache-maven-3.2.3/bin
JAVA_HOME=/usr/java/jdk1.7.0_67
export JAVA_HOME
export PATH
|
3. 安装protobuf这是google的一个用于数据交换格式的..
下载地址: https://code.google.com/p/protobuf/downloads/list
1
2
3
4
5
6
7
8 |
wget https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz
tar xf protobuf-2.5.0.tar.gz
cd protobuf-2.5.0
./configure
make
make install
ls -l /usr/local/bin/protoc
|
4. 获取hadoop程序源代码svn地址: http://svn.apache.org/repos/asf/hadoop/common/tags/
1
2
3 |
svn checkout http://svn.apache.org/repos/asf/hadoop/common/tags/release-2.2.0/
cd release-2.2.0
mvn 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 找到编译好的本地库
(责任编辑:IT) |
------分隔线----------------------------