Centos7 Apache-Ambari-2.7.6 编译安装

 

参考文章

https://blog.csdn.net/ZhouyuanLinli/article/details/88963289

https://blog.csdn.net/whq12789/article/details/104840597/

 

系统准备

本次操作均在centos7 docker下安装完成,首先我们获取一个全新的centos7

由于安装过程中,maven下载的引用包,国内有些资源无法下载,方便出国,使用 --network host 参数启动,与宿主机使用同一网络

# docker pull centos:centos7
# docker run --name centos7 --network host -itd centos:centos7


环境准备(Docker Centos7中,后续编译均在容器中完成) 

wget jdk-8u291-linux-x64.tar.gz
wget apache-maven-3.8.1-bin.tar.gz

vim /etc/profile
export JAVA_HOME="/home/jdk1.8.0_291"
export PATH="${JAVA_HOME}/bin:$PATH"
export MAVEN_HOME="/home/apache-maven-3.8.1"
export PATH="${MAVEN_HOME}/bin:$PATH"

source /etc/profile

yum install vim -y
yum install wget -y
yum install epel-release -y
yum install rpm-build -y
yum install gcc-c++ -y
yum install git -y
yum install python-devel.x86_64 -y
wget https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg#md5=fe1f997bc722265116870bc7919059ea
sh setuptools-0.6c11-py2.7.egg

curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
python get-pip.py

curl -fsSL https://rpm.nodesource.com/setup_16.x | bash -
yum install nodejs -y

curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo
yum install yarn -y

 

 

下载 Apache-Ambari-2.7.6

wget https://www-eu.apache.org/dist/ambari/ambari-2.7.6/apache-ambari-2.7.6-src.tar.gz
tar xfvz apache-ambari-2.7.6-src.tar.gz
cd apache-ambari-2.7.6-src
mvn versions:set -DnewVersion=2.7.6.0.0
 
pushd ambari-metrics
mvn versions:set -DnewVersion=2.7.6.0.0
popd

 

调整 Apache-Ambari-2.7.6

后续编译的时候,发现无法完整下载到对应的 phoenix-core 版本 5.0.0-HBase-2.0,后来发现存在 javax.el 下载不到,所以单独引入固定版本,如果你的引用没问题,可以不改

加粗字体为新增部分

vim apache-ambari-2.7.6-src/ambari-metrics/ambari-metrics-timelineservice/pom.xml
<phoenix.version>5.0.0-HBase-2.0</phoenix.version> <dependency> <groupId>org.apache.phoenix</groupId> <artifactId>phoenix-core</artifactId> <version>${phoenix.version}</version> <exclusion> <groupId>org.glassfish</groupId> <artifactId>javax.el</artifactId> </exclusion> </dependency> <dependency> <groupId>org.apache.phoenix</groupId> <artifactId>phoenix-core</artifactId> <version>${phoenix.version}</version> <scope>test</scope> <exclusion> <groupId>org.glassfish</groupId> <artifactId>javax.el</artifactId> </exclusion> </dependency> <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.el</artifactId> <version>3.0.0</version> </dependency>

 

编译 Apache-Ambari-2.7.6

-Drat.skip=true 添加该参数跳过rat检查(error: too many files are open)

mvn -B clean install rpm:rpm -DnewVersion=2.7.6.0.0 -DbuildNumber=388e072381e71c7755673b7743531c03a4d61be8 -Drat.skip=true -DskipTests -Dpython.ver="python >= 2.6"

 

 编译过程如果网络不好,下载不到对应相关依赖导致失败,需要从失败位置继续编译

find ~/.m2/repository/ -name "*.lastUpdated" -exec rm -rf {} \;

 

 

编译成功

[INFO] --- rpm-maven-plugin:2.1.4:rpm (default-cli) @ ambari-infra-manager-it ---
[INFO] Creating directory /home/apache-ambari-2.7.6-src/ambari-infra/ambari-infra-manager-it/target/rpm/ambari-infra-manager-it
[INFO] Creating directory /home/apache-ambari-2.7.6-src/ambari-infra/ambari-infra-manager-it/target/rpm/ambari-infra-manager-it/BUILD
[INFO] Creating directory /home/apache-ambari-2.7.6-src/ambari-infra/ambari-infra-manager-it/target/rpm/ambari-infra-manager-it/RPMS
[INFO] Creating directory /home/apache-ambari-2.7.6-src/ambari-infra/ambari-infra-manager-it/target/rpm/ambari-infra-manager-it/SOURCES
[INFO] Creating directory /home/apache-ambari-2.7.6-src/ambari-infra/ambari-infra-manager-it/target/rpm/ambari-infra-manager-it/SPECS
[INFO] Creating directory /home/apache-ambari-2.7.6-src/ambari-infra/ambari-infra-manager-it/target/rpm/ambari-infra-manager-it/SRPMS
[INFO] Creating directory /home/apache-ambari-2.7.6-src/ambari-infra/ambari-infra-manager-it/target/rpm/ambari-infra-manager-it/tmp-buildroot
[INFO] Creating directory /home/apache-ambari-2.7.6-src/ambari-infra/ambari-infra-manager-it/target/rpm/ambari-infra-manager-it/buildroot
[INFO] Creating spec file /home/apache-ambari-2.7.6-src/ambari-infra/ambari-infra-manager-it/target/rpm/ambari-infra-manager-it/SPECS/ambari-infra-manager-it.spec
[INFO] Building target platforms: noarch-redhat-linux
[INFO] Building for target noarch-redhat-linux
[INFO] Processing files: ambari-infra-manager-it-2.7.6.0-0.noarch
[INFO] Provides: ambari-infra-manager-it = 2.7.6.0-0
[INFO] Requires(rpmlib): rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1
[INFO] Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/apache-ambari-2.7.6-src/ambari-infra/ambari-infra-manager-it/target/rpm/ambari-infra-manager-it/buildroot
[INFO] Wrote: /home/apache-ambari-2.7.6-src/ambari-infra/ambari-infra-manager-it/target/rpm/ambari-infra-manager-it/RPMS/noarch/ambari-infra-manager-it-2.7.6.0-0.noarch.rpm
[INFO] Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.9QgpuM
[INFO] + umask 022
[INFO] + cd /home/apache-ambari-2.7.6-src/ambari-infra/ambari-infra-manager-it/target/rpm/ambari-infra-manager-it/BUILD
[INFO] + /usr/bin/rm -rf /home/apache-ambari-2.7.6-src/ambari-infra/ambari-infra-manager-it/target/rpm/ambari-infra-manager-it/buildroot
[INFO] + exit 0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Ambari Main 2.7.6.0.0 .............................. SUCCESS [  2.181 s]
[INFO] Apache Ambari Project POM 2.7.6.0.0 ................ SUCCESS [  0.113 s]
[INFO] Ambari Web 2.7.6.0.0 ............................... SUCCESS [ 42.742 s]
[INFO] Ambari Views 2.7.6.0.0 ............................. SUCCESS [  0.697 s]
[INFO] Ambari Admin View 2.7.6.0.0 ........................ SUCCESS [ 27.444 s]
[INFO] ambari-utility 1.0.0.0-SNAPSHOT .................... SUCCESS [  9.768 s]
[INFO] ambari-metrics 2.7.6.0.0 ........................... SUCCESS [  0.769 s]
[INFO] Ambari Metrics Common 2.7.6.0.0 .................... SUCCESS [  4.719 s]
[INFO] Ambari Metrics Hadoop Sink 2.7.6.0.0 ............... SUCCESS [  8.091 s]
[INFO] Ambari Metrics Flume Sink 2.7.6.0.0 ................ SUCCESS [  1.399 s]
[INFO] Ambari Metrics Kafka Sink 2.7.6.0.0 ................ SUCCESS [  1.349 s]
[INFO] Ambari Metrics Storm Sink 2.7.6.0.0 ................ SUCCESS [  1.541 s]
[INFO] Ambari Metrics Storm Sink (Legacy) 2.7.6.0.0 ....... SUCCESS [  1.439 s]
[INFO] Ambari Metrics Collector 2.7.6.0.0 ................. SUCCESS [03:31 min]
[INFO] Ambari Metrics Monitor 2.7.6.0.0 ................... SUCCESS [  0.799 s]
[INFO] Ambari Metrics Grafana 2.7.6.0.0 ................... SUCCESS [  1.249 s]
[INFO] Ambari Metrics Host Aggregator 2.7.6.0.0 ........... SUCCESS [  5.937 s]
[INFO] Ambari Metrics Assembly 2.7.6.0.0 .................. SUCCESS [01:37 min]
[INFO] Ambari Service Advisor 1.0.0.0-SNAPSHOT ............ SUCCESS [  0.197 s]
[INFO] Ambari Server 2.7.6.0.0 ............................ SUCCESS [02:59 min]
[INFO] Ambari Functional Tests 2.7.6.0.0 .................. SUCCESS [  0.417 s]
[INFO] Ambari Agent 2.7.6.0.0 ............................. SUCCESS [01:06 min]
[INFO] ambari-logsearch 2.7.6.0.0 ......................... SUCCESS [  0.546 s]
[INFO] Ambari Logsearch Appender 2.7.6.0.0 ................ SUCCESS [  0.202 s]
[INFO] Ambari Logsearch Config Api 2.7.6.0.0 .............. SUCCESS [  0.161 s]
[INFO] Ambari Logsearch Config JSON 2.7.6.0.0 ............. SUCCESS [  0.157 s]
[INFO] Ambari Logsearch Config Solr 2.7.6.0.0 ............. SUCCESS [  0.149 s]
[INFO] Ambari Logsearch Config Zookeeper 2.7.6.0.0 ........ SUCCESS [  0.153 s]
[INFO] Ambari Logsearch Config Local 2.7.6.0.0 ............ SUCCESS [  0.141 s]
[INFO] Ambari Logsearch Log Feeder Plugin Api 2.7.6.0.0 ... SUCCESS [  0.163 s]
[INFO] Ambari Logsearch Log Feeder Container Registry 2.7.6.0.0 SUCCESS [  0.269 s]
[INFO] Ambari Logsearch Log Feeder 2.7.6.0.0 .............. SUCCESS [  3.433 s]
[INFO] Ambari Logsearch Web 2.7.6.0.0 ..................... SUCCESS [ 43.296 s]
[INFO] Ambari Logsearch Server 2.7.6.0.0 .................. SUCCESS [  5.052 s]
[INFO] Ambari Logsearch Assembly 2.7.6.0.0 ................ SUCCESS [  0.131 s]
[INFO] Ambari Logsearch Integration Test 2.7.6.0.0 ........ SUCCESS [  0.584 s]
[INFO] ambari-infra 2.7.6.0.0 ............................. SUCCESS [  0.137 s]
[INFO] Ambari Infra Solr Client 2.7.6.0.0 ................. SUCCESS [  9.712 s]
[INFO] Ambari Infra Solr Plugin 2.7.6.0.0 ................. SUCCESS [  0.380 s]
[INFO] Ambari Infra Manager 2.7.6.0.0 ..................... SUCCESS [  5.189 s]
[INFO] Ambari Infra Assembly 2.7.6.0.0 .................... SUCCESS [  0.136 s]
[INFO] Ambari Infra Manager Integration Tests 2.7.6.0.0 ... SUCCESS [  0.984 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  12:15 min
[INFO] Finished at: 2021-12-31T18:01:32Z
[INFO] ------------------------------------------------------------------------

 

posted @ 2022-01-03 21:34  牵祢丶左手  阅读(1328)  评论(0编辑  收藏  举报