HadoopHadoop2.8编译
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HadoopHadoop2.8编译相关的知识,希望对你有一定的参考价值。
Hadoop编译步骤:
1.解压Hadoop源码包
[[email protected] ~]# mkdir -p /opt/sourcecode
[[email protected] ~]# mkdir -p /opt/software
[[email protected] sourcecode]# cd /opt/sourcecode
# 将hadoop-2.8.1-src.tar.gz下载(或者用rz上传)到sourcecode目录
[[email protected] sourcecode]# ll
total 33756
-rw-r--r--. 1 root root 34523353 Aug 20 12:14 hadoop-2.8.1-src.tar.gz
# 解压
[[email protected] sourcecode]# tar -xzvf hadoop-2.8.1-src.tar.gz
[[email protected] sourcecode]# ll
total 33760
drwxr-xr-x. 17 root root 4096 Jun 2 14:13 hadoop-2.8.1-src
-rw-r--r--. 1 root root 34523353 Aug 20 12:14 hadoop-2.8.1-src.tar.gz
[[email protected] sourcecode]# cd hadoop-2.8.1-src
2.JAVA安装
[[email protected] ~]# mkdir -p /usr/java
[[email protected] ~]# cd /usr/java
[[email protected] java]# rz #上传jdk-8u45-linux-x64.gz
[[email protected] java]# tar -xzvf jdk-8u45-linux-x64.gz
# 设置环境变量
[[email protected] java]# vi /etc/profile
# 在最底下加入
export JAVA_HOME=/usr/java/jdk1.8.0_45
export PATH=$JAVA_HOME/bin:$PATH
# 生效
[[email protected] java]# source /etc/profile
3.Maven安装
[[email protected] ~]# cd /opt/software/
[[email protected] software]# rz #上传apache-maven-3.3.9-bin.zip
[[email protected] software]# ll
total 8432
-rw-r--r--. 1 root root 8617253 Aug 20 12:35 apache-maven-3.3.9-bin.zip
# 解压
[[email protected] software]# unzip apache-maven-3.3.9-bin.zip
# 设置环境变量
[[email protected] software]# vi /etc/profile
export MAVEN_HOME=/opt/software/apache-maven-3.3.9
export MAVEN_OPTS="-Xms256m -Xmx512m"
export PATH=$MAVEN_HOME/bin:$JAVA_HOME/bin:$PATH
# 生效
[[email protected] software]# source /etc/profile
# 查看
[[email protected] software]# mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /opt/software/apache-maven-3.3.9
Java version: 1.8.0_45, vendor: Oracle Corporation
Java home: /usr/java/jdk1.8.0_45/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-431.el6.x86_64", arch: "amd64", family: "unix"
4.Findbugs安装
[[email protected] ~]# cd /opt/software/
[[email protected] software]# rz #上传findbugs-1.3.9.zip
# 解压
[[email protected] software]# unzip findbugs-1.3.9.zip
# 设置环境变量
[[email protected] software]# vi /etc/profile
export FINDBUGS_HOME=/opt/software/findbugs-1.3.9
export PATH=$FINDBUGS_HOME/bin:$MAVEN_HOME/bin:$JAVA_HOME/bin:$PATH
# 生效
[[email protected] software]# source /etc/profile
# 查看
[[email protected] software]# findbugs -version
1.3.9
5.protobuf安装
[[email protected] ~]# cd /opt/software/
[[email protected] software]# rz #上传protobuf-2.5.0.tar.gz
# 解压
[[email protected] software]# tar -xzvf protobuf-2.5.0.tar.gz
[[email protected] software]# cd protobuf-2.5.0
[[email protected] protobuf-2.5.0]# yum install -y gcc gcc-c++ make cmake
[[email protected] protobuf-2.5.0]# ./configure --prefix=/usr/local/protobuf
[[email protected] protobuf-2.5.0]# make && make install
# 设置环境变量
[[email protected] java]# vi /etc/profile
export PROTOC_HOME=/usr/local/protobuf
export PATH=$PROTOC_HOME/bin:$FINDBUGS_HOME/bin:$MAVEN_HOME/bin:$JAVA_HOME/bin:$PATH
# 生效
[[email protected] protobuf-2.5.0]# source /etc/profile
# 查看
[[email protected] protobuf-2.5.0]# protoc --version
libprotoc 2.5.0
6.安装其他依赖
yum install -y openssl openssl-devel svn ncurses-devel zlib-devel libtool
yum install -y snappy snappy-devel bzip2 bzip2-devel lzo lzo-devel lzop autoconf automake
7.编译
[[email protected] sourcecode]# cd hadoop-2.8.1-src
[[email protected] hadoop-2.8.1-src]# mvn clean package -Pdist,native -DskipTests -Dtar
#稍等一段时间 出现以下信息即编译完成
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13:38 min
[INFO] Finished at: 2018-05-16T15:18:47+08:00
[INFO] Final Memory: 173M/478M
[INFO] ------------------------------------------------------------------------
编译好的tar包路径
/opt/sourcecode/hadoop-2.8.1-src/hadoop-dist/target/hadoop-2.8.1.tar.gz
以上是关于HadoopHadoop2.8编译的主要内容,如果未能解决你的问题,请参考以下文章
Android 逆向Android 逆向通用工具开发 ( Android 平台运行的 cmd 程序类型 | Android 平台运行的 cmd 程序编译选项 | 编译 cmd 可执行程序 )(代码片段
错误记录Android Studio 编译报错 ( Could not determine java version from ‘11.0.8‘. | Android Studio 降级 )(代码片段