当前位置:   article > 正文

Ambari 源码编译及编译问题的解决_2.7.5 amabri metrics colletcor编译失败

2.7.5 amabri metrics colletcor编译失败

Ambari 源码编译及编译问题的解决

编译

想要编译最新的代码,则直接参考官网的教程即可:主要有一下命令(以版本2.7.1为例):

wget http://www.apache.org/dist/ambari/ambari-2.7.1/apache-ambari-2.7.1-src.tar.gz (use the suggested mirror from above)
tar xfvz apache-ambari-2.7.1-src.tar.gz
cd apache-ambari-2.7.1-src
mvn versions:set -DnewVersion=2.7.1.0.0

pushd ambari-metrics
mvn versions:set -DnewVersion=2.7.1.0.0
popd

mvn -B clean install rpm:rpm -DnewVersion=2.7.1.0.0 -DbuildNumber=90430db08a5f543a97d97918cf5f711f2786ad8a \
-DskipTests -Dpython.ver="python >= 2.6" 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

Ambari官网安装指南

问题解决

添加命令

按照自己的经验,想要开官网的指南想编译成功几乎是不可能的。
所以首先 在某一步出现问题之后需要知道编译不需要重新开始,只需要在失败的地方开始就行,比如在ambari-metrics失败了,解决问题之后,可以用一下命令开始:

mvn -B  install rpm:rpm -DnewVersion=2.7.1.0.0 -DbuildNumber=90430db08a5f543a97d97918cf5f711f2786ad8a \
-Dpython.ver="python >= 2.6" \
-rf :ambari-metrics
  • 1
  • 2
  • 3

需要注意的是将clean 去掉。

有一篇比较不错的相关文章:
Ambari编译问题解决 里面列出了好多常见的错误情况。
以我自己的经验在命令行中添加一些命令可以防止两个错误:

mvn -B clean install rpm:rpm -DnewVersion=2.7.1.0.0 -DbuildNumber=90430db08a5f543a97d97918cf5f711f2786ad8a \
-DskipTests -Dpython.ver="python >= 2.6" \
-Dcheckstyle.skip \
-Drat.skip=true 
  • 1
  • 2
  • 3
  • 4

替换大文件的链接

在编译 ambari-metrics的有Hadoop和hbase几个大文件需要下载,我们可以自己下载号,修改pom.xml对应的链接即可:
进入ambari-metrics目录:
修改pom.xml为

 <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <python.ver>python &gt;= 2.6</python.ver>
    <deb.python.ver>python (&gt;= 2.6)</deb.python.ver>
    <!--TODO change to HDP URL-->
    <hbase.tar>http://192.168.56.1/hbase-2.0.0.3.0.0.0-1634-bin.tar.gz</hbase.tar>
    <hbase.folder>hbase-2.0.0.3.0.0.0-1634</hbase.folder>
    <hadoop.tar>http://192.168.56.1/hadoop-3.1.0.3.0.0.0-1634.tar.gz</hadoop.tar>
    <hadoop.folder>hadoop-3.1.0.3.0.0.0-1634</hadoop.folder>
    <grafana.folder>grafana-2.6.0</grafana.folder>
    <grafana.tar>http://192.168.56.1/grafana-2.6.0.linux-x64.tar.gz</grafana.tar>
    <phoenix.tar>http://192.168.56.1/phoenix-5.0.0.3.0.0.0-1634.tar.gz</phoenix.tar>
    <phoenix.folder>phoenix-5.0.0.3.0.0.0-1634</phoenix.folder>
    <resmonitor.install.dir>/usr/lib/python2.6/site-packages/resource_monitoring</resmonitor.install.dir>
    <powermock.version>1.6.2</powermock.version>
    <distMgmtSnapshotsId>apache.snapshots.https</distMgmtSnapshotsId>
    <distMgmtSnapshotsName>Apache Development Snapshot Repository</distMgmtSnapshotsName>
    <distMgmtSnapshotsUrl>https://repository.apache.org/content/repositories/snapshots</distMgmtSnapshotsUrl>
    <distMgmtStagingId>apache.staging.https</distMgmtStagingId>
    <distMgmtStagingName>Apache Release Distribution Repository</distMgmtStagingName>
    <distMgmtStagingUrl>https://repository.apache.org/service/local/staging/deploy/maven2</distMgmtStagingUrl>
    <fasterxml.jackson.version>2.9.5</fasterxml.jackson.version>
  </properties>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23

我这是下载好,放在了自己的http服务下。

科学上网

这个工程需要非常非常多的依赖,中间的rpm编译结果还需要很大的中间存储,首先得保证磁盘空间够。还有就是依赖下载慢或者下载不下来,那这时候就需要科学上网,并需要配置终端也可通过代理链接,这个方法此处不表。

update

版本2.7.1的server 编译有bug ,需要修改pom.xml的一个值:
在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/705887
推荐阅读
相关标签
  

闽ICP备14008679号