native.下载地址:http://dl.bintray.com/sequenceiq/sequenceiq-bin/。请下载好对应版本的.tar包
然而这些native还停留在2.x版本。无奈只能自己动手
1.环境准备
系统:
[root@devopes ~]# uname -r 3.10.0-1127.19.1.el7.x86_64
JDK:(务必一致,因为在编译过程中因为jdk1.8的版本更换过2次)
[root@devopes ~]# java -version java version "1.8.0_211" Java(TM) SE Runtime Environment (build 1.8.0_211-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
链接:https://pan.baidu.com/s/11XEKRWVbUy95CpNgg-xT9Q
提取码:prq7
Maven:(务必一致,因为在编译过程中因为maven3系列版本更换过3次)
[root@devopes ~]# mvn -v Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T02:33:14+08:00) Maven home: /usr/local/apache-maven-3.5.4 Java version: 1.8.0_211, vendor: Oracle Corporation, runtime: /usr/local/jdk1.8.0_211/jre Default locale: zh_CN, platform encoding: UTF-8 OS name: "linux", version: "3.10.0-1127.19.1.el7.x86_64", arch: "amd64", family: "unix"
链接:https://pan.baidu.com/s/1hhMkeyBm3EWKg3dPL9k9kQ
提取码:maqj
cmake:(3.13.5)
[root@devopes ~]# cmake --version cmake version 3.13.5
链接:https://pan.baidu.com/s/1R6nmLbFnGnLg8yJ9KOtyLA
提取码:c99c
ProtocolBuffer:(2.5.0)
[root@devopes ~]# protoc --version libprotoc 2.5.0
链接:https://pan.baidu.com/s/1y1eCZrPYW0Xhm8KsLXX4xw
提取码:pukb
ant:(1.10.8)
[root@devopes ~]# ant -version Apache Ant(TM) version 1.10.8 compiled on May 10 2020
链接:https://pan.baidu.com/s/1QqzG43T6FuZy_UiapmiI5A
提取码:8fpt
findbugs:(3.0.1)
[root@devopes ~]# /usr/local/findbugs/bin/findbugs -version 3.0.1
链接:https://pan.baidu.com/s/1gi22opzeDxzr5A4YhR5BsA
提取码:dlkd
hadoop源码:(3.1.4)
链接:https://pan.baidu.com/s/1lW5IDTh5H-5m5fy5p7WLWw
提取码:sg72
2.软件安装
所有软件上传解压到自己的软件安装目录(我的在/usr/local)
[root@devopes local]# ll drwxr-xr-x 6 root root 235 5月 10 22:33 apache-ant-1.10.8 drwxr-xr-x 6 root root 99 6月 17 2018 apache-maven-3.5.4 drwxr-xr-x 15 root root 4096 9月 11 10:22 cmake-3.13.5 drwxr-xr-x 8 root root 104 3月 6 2015 findbugs drwxr-xr-x 7 root root 245 9月 11 16:38 jdk1.8.0_211 drwxr-xr-x 5 root root 43 9月 11 10:26 protobuf
1.jdk
tar xf jdk-8u211-linux-x64.tar.gz echo "export JAVA_HOME=/usr/local/jdk1.8.0_211" >>/etc/profile echo "export PATH=$JAVA_HOME/bin:$PATH" >>/etc/profile source /etc/profile
安装完成后输出版本号正常则安装成功
2.maven
unzip apache-maven-3.5.4-bin.zip echo "export MAVEN_HOME=/usr/local/apache-maven-3.5.4" >>/etc/profile echo "export "PATH=$MAVEN_HOME/bin:$PATH" >>/etc/profile
source /etc/profile
修改配置文件settings.xml
[root@devopes local]# vim /usr/local/apache-maven-3.5.4/conf/settings.xml
<!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository
<localRepository>/path/to/local/repo</localRepository> #默认在当前用户家目录下的.m2下
-->
<localRepository>/home/.m2/repository</localRepository> #自己配置本地仓库路径(可以设置在空间较为大的分区)
#配置镜像地址,由于编译要下载很多依赖包,官方的仓库在国外下载速度较慢,可以配置国内地址,但是国内镜像更新速度又较慢有些包的版本跟不上 还是要配些其他的镜像地址
<mirrors>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
<mirror>
<id>nexus-aliyun-apache</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun apache</name>
<url>http://maven.aliyun.com/nexus/content/repositories/apache-snapshots/</url>
</mirror>
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*,!jeecg,!jeecg-snapshots,!mapr-releases</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
<mirror>
<id>mapr-public</id>
<mirrorOf>mapr-releases</mirrorOf>
<name>mapr-releases</name>
<url>https://maven.aliyun.com/repository/mapr-public</url>
</mirror>
<mirror>
<id>repo2</id>
<name>Mirror from Maven Repo2</name>
<url>http://repo2.maven.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>jboss-public-repository-group</id>
<mirrorOf>central</mirrorOf>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public</url>
</mirror>
<mirror>
<id>ui</id>
<name>Mirror from UK</name>
<url>http://uk.maven.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<!-- junit镜像地址 -->
<mirror>
<id>junit</id>
<name>junit Address/</name>
<url>http://jcenter.bintray.com/</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>ibiblio</id>
<name>Mirror from Maven ibiblio</name>
<url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
安装完成后输出版本号正常则安装成功
3.ant
tar xf apache-ant-1.10.8-bin.tar.gz echo "export ANT_HOME=/usr/local/apache-ant-1.10.8" /etc/profile echo "export PATH=$ANT_HOME/bin:$PATH" /etc/profile source /etc/profile
安装完成后输出版本号正常则安装成功
4.cmake
rpm -qa|grep "cmake" #检查机器上是否已经有cmake 如果存在已安装的cmake执行以下命令卸载
rpm -e +软件包名字(通过第一步获取完完整包名)或者强制卸载 rpm -e --nodeps +软件包 tar xf cmake-3.13.5.tar.gz cd cmake-3.13.5 ./configure make && make insatll 编译完成可以执行下echo $?如果为0则成功不为0则失败
完成编译后输出版本号正常则安装成功
5.ProtocolBuffer
tar xf protobuf-2.5.0.tar.gz cd protobuf-2.5.0 ./configure --prefix=/usr/local/protobuf #可以指定编译到某个文件 也可以不加这个直接在当前目录生成编译文件 如果指定了该路径编译完成后删除当前目录 软件已在另一个目录生成 make && make install #同上可以检测是否编译成功 echo "export PROTOC_HOME=/usr/local/protobuf >>/etc/profile echo "export PATH=$PROTOC_HOME/bin:$PATH" >>/ect/profile
完成编译后输出版本号正常则安装成功
6.findbugs
unzip findbugs-3.0.1.zip echo "export FINDBUGS_HOME=/usr/local/findbugs" >>/etc/profile echo "export PATH=$FINDBUGS_HOME/bin:$PATH" >>/ect/profile source /etc/profile
安装完成后输出版本号正常则安装成功
3.编译hadoop
[root@devopes work]# tar xf hadoop-3.1.4-src.tar.gz [root@devopes work]# cd hadoop-3.1.4-src/ [root@devopes hadoop-3.1.4-src]# mvn clean package -DskipTests -Pdist,native -Dtar .................................
编译过程中如果中断了大多数情况下是国外包下载延迟问题,可以选择在网速较好的情况下执行,博主白天下午编译三小时才跑了10来个包,早上来半小时编译完成。以下图片证明
最终产物:
链接:https://pan.baidu.com/s/1OFZp0AOg92-Fxyg5xJRaZw
提取码:7mxv