西部数码主机 | 阿里云主机| 虚拟主机 | 服务器 | 返回乐道官网
当前位置: 主页 > 开发教程 > linux教程 >

linux centos 安装编译hadoop2.7.1

时间:2016-10-19 18:03来源:未知 作者:好模板编辑 点击:
因为Apache hadoop 只提供了32位的包,所以需要自己编译64位的包,下面是编译步骤 所需要的包 1:apache-ant-1.9.7-bin.tar.gz(http://mirrors.tuna.tsinghua.edu.cn/apache//ant/binaries/apache-ant-1.9.7-bin.tar.gz)
因为Apache hadoop 只提供了32位的包,所以需要自己编译64位的包,下面是编译步骤
 
所需要的包
 
1:apache-ant-1.9.7-bin.tar.gz(http://mirrors.tuna.tsinghua.edu.cn/apache//ant/binaries/apache-ant-1.9.7-bin.tar.gz)
 
2:apache-maven-3.3.9-bin.tar.gz(必需是maven3,http://apache.fayea.com/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz)
 
3:findbugs-1.3.9.tar.gz(https://sourceforge.net/projects/findbugs/files/findbugs/1.3.9/)
 
4:protobuf-2.5.0.tar.gz(必需是这个版本https://github.com/google/protobuf/releases?after=v2.6.1)
 
5:hadoop-2.7.1-src.tar.gz(http://apache.fayea.com/hadoop/common/hadoop-2.7.1/hadoop-2.7.1-src.tar.gz)
 
6:java 1.7+
 
下面是具体安装:
 
1:Java安装
 
安装之前请卸载系统自带的jdk,openjdk
 
下载:wget http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-i586.rpm?AuthParam=1473648193_bea6ceb97e2e395cd3bad796320ff177
rpm -ivh jdk-7u79-linux-i586.rpm
vi /etc/profile 添加java环境变量
export JAVA_HOME=/usr/java/jdk1.7.0_79
export M3_HOME=/home/data/app/apache-maven-3.3.9
 
export FINDBUGS_HOME=/home/data/app/findbugs-1.3.9
 
export ANT_HOME=/home/data/app/apache-ant-1.9.7
 
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
 
export PATH=$PATH:$JAVA_HOME/bin:$M3_HOME/bin:$FINDBUGS_HOME/bin:$ANT_HOME/bin(这个是我已经安装好的,可以自行删减)
 
5. java -version 查看java是否安装成功
 
2:apache-ant-1.9.7-bin.tar.gz 安装
 
1.tar -zxvf apache-ant-1.9.7-bin.tar.gz 解压
 
2.vi /etc/profile 添加ant环境变量(因为上一步我已经添加了所以这里就不用加了)
 
3.ant -version
 
3:apache-maven-3.3.9-bin.tar.gz 安装
 
1.tar -zxvf apache-maven-3.3.9-bin.tar.gz 解压
 
2.vi /etc/profile 添加ant环境变量(因为上一步我已经添加了所以这里就不用加了)
 
3.mvn -version
 
4:findbugs-1.3.9.tar.gz 安装
 
1.tar -zxvf findbugs-1.3.9.tar.gz
 
2.vi /etc/profile 添加ant环境变量(因为上一步我已经添加了所以这里就不用加了)
 
3.findbugs -version
 
5:protobuf-2.5.0.tar.gz 安装
 
1.tar -zxvf protobuf-2.5.0.tar.gz 解压
 
2.cd protobuf-2.5.0
 
3. ./configure
 
4. make install(如果make 没有安装,请执行yum -y install autoconf automake libtool cmake ncurses-devel openssl-devel lzo-devel zlib-devel gcc gcc-c++)
 
5.vi /etc/profile 添加ant环境变量(因为上一步我已经添加了所以这里就不用加了)
 
6:hadoop-2.7.1-src.tar.gz 编译
 
1.tar -zxvf hadoop-2.7.1-src.tar.gz 解压
 
2.mvn package -Pdist,native -DskipTests -Dtar
 
编译完成后的bin版本在目录 hadoop-dist下
 
编译过程中可能出现的错误
 
[ERROR] Failed to execute goal on project hadoop-common: Could not resolve dependencies for project org.apache.hadoop:hadoop-common:jar:2.7.1: Could not transfer artifact org.apache.commons:commons-math3:jar:3.1.1 from/to nexus-osc (http://maven.oschina.net/content/groups/public/): GET request of: org/apache/commons/commons-math3/3.1.1/commons-math3-3.1.1.jar from nexus-osc failed: Premature end of Content-Length delimited message body (expected: 1599627; received: 866169 -> [Help 1]
 
[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:2.7.1:protoc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecutionException: ‘protoc –version’ did not return a version -> [Help 1]
 
缺这缺那的,用thrift编译说明提到的一个把开发工具全装上。
 
yum -y groupinstall “Development Tools”
 
需要安装ant, yum install ant
 
Caused by: org.apache.maven.plugin.MojoExecutionException: An Ant BuildException has occured: Execute failed: java.io.IOException: Cannot run program “cmake” (in directory “/root/hadoop-2.7.1-src/hadoop-common-project/hadoop-common/target/native”): error=2, No such file or directory
 
需要安装 findbugs  
 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (site) on project hadoop-common: An Ant BuildException has occured: stylesheet /home/hadoop/hadoop-2.7.1-src/hadoop-common-project/hadoop-common/${env.FINDBUGS_HOME}/src/xsl/default.xsl doesn’t exist.
 
[ERROR] around Ant part …<xslt in=”/home/hadoop/hadoop-2.7.1-src/hadoop-common-project/hadoop-common/target/findbugsXml.xml” style=”${env.FINDBUGS_HOME}/src/xsl/default.xsl” out=”/home/hadoop/hadoop-2.7.1-src/hadoop-common-project/hadoop-common/target/site/findbugs.html”/>… @ 43:251 in /home/hadoop/hadoop-2.7.1-src/hadoop-common-project/hadoop-common/target/antrun/build-main.xml
 
然后设置环境变量  export FINDBUGS_HOME=/usr/local/findbugs-3.0.0
 
需要安装cmake
 
Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (make) on
 
project hadoop-pipes: An Ant BuildException has occured: exec returned: 1
 
[ERROR] around Ant part …<exec dir=”/home/pory/workplace/hadoop-2.4.1-src/hadoop-
 
tools/hadoop-pipes/target/native” executable=”cmake” failonerror=”true”>… @ 5:131 in
 
/home/pory/workplace/hadoop-2.4.1-src/hadoop-tools/hadoop-pipes/target/antrun/build-
 
main.xml
 
安装zlib-dev 和 libssl-dev ,可能在groupinstall已经安装了。
 
//kms这个,换个目录重新编译或者多试几次,因为下载tomcat超时导致的问题。
 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (dist) on project hadoop-kms: An Ant BuildException has occured: exec returned: 2
 
[ERROR] around Ant part …<exec failonerror=”true” dir=”/home/hadoop/hadoop-2.7.1-src/hadoop-common-project/hadoop-kms/target” executable=”sh”>… @ 10:120 in /home/hadoop/hadoop-2.7.1-src/hadoop-common-project/hadoop-kms/target/antrun/build-main.xml
 
[ERROR] -> [Help 1]
 
(责任编辑:好模板)
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
栏目列表
热点内容