欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Hadoop2.7.7源码编译(Centos6.10)

程序员文章站 2022-07-12 11:48:16
...

源码包准备【hadoop-2.7.7-src.tar.gz】

 

解压后找到构建说明【BUILDING.txt】,看一下基本要求都有什么

Hadoop2.7.7源码编译(Centos6.10)

安装以下软件【以防万一】没有列全:

yum install -y gcc
yum install -y gcc-c++
yum install -y make

* Unix System

Centos6.10

 

* JDK 1.7+

 

* Maven 3.0 or later

#maven
export M2_HOME=/opt/apache-maven-3.3.9
export PATH=$PATH:$M2_HOME/bin
####################################################
mvn -version

Hadoop2.7.7源码编译(Centos6.10)

 

* Findbugs 1.3.9 (if running findbugs)

#findbugs
export FINDBUGS_HOME=/opt/findbugs-3.0.0
export PATH=$PATH:$FINDBUGS_HOME/bin
####################################################
findbugs -version

Hadoop2.7.7源码编译(Centos6.10)

 

* ProtocolBuffer 2.5.0

./configure --prefix=/opt/protobuf-2.5.0
make
make check  #可以忽略
make install
####################################################
#proto
export PROTOBUF_HOME=/opt/protobuf-2.5.0
export PATH=$PATH:$PROTOBUF_HOME/bin
####################################################
protoc --version

Hadoop2.7.7源码编译(Centos6.10)

 

* Zlib devel (if compiling native code)

yum install -y zlib zlib-devel

 

* openssl devel ( if compiling native hadoop-pipes and to get the best HDFS encryption performance )

yum install -y openssl devel

 

* Internet connection for first build (to fetch all Maven and Hadoop dependencies)

 

ant

#ant
export ANT_HOME=/opt/apache-ant-1.10.5
export PATH=$PATH:$ANT_HOME/bin
####################################################
ant -version

Hadoop2.7.7源码编译(Centos6.10)

 

snappy

./autogen.sh
./configure
make
make install
ls -lh /usr/local/lib | grep snappy

 

Hadoop2.7.7源码编译(Centos6.10)


Building:

编译进入/root/hadoop/hadoop-2.7.7-src

export MAVEN_OPTS="-Xms512m -Xmx1024m" #适当调整
mvn package -Pdist,native -DskipTests -Dtar

编译成功,整个过程有很多坑,其实总时间也就10分多钟

Hadoop2.7.7源码编译(Centos6.10)