首页 > 运维 > linux运维 > 正文

ambari 2.7.6源码编译指南

蓮花仙者
发布: 2025-07-10 11:38:14
原创
553人浏览过

centos 7.6上使用maven 3.6.3进行ambari 2.7.6源码编译的指南

由于编译过程中需要的某些JAR包难以下载,本文提供了一个专门用于Ambari编译的Maven仓库。您只需将该仓库替换到您的.m2/repository目录中即可。

提供的仓库文件:repository.tar.gz

提取码:ambari

软件安装

yum install -y wget git psutils python-devel rpm-build java-1.8.0-openjdk-devel
登录后复制

搭建HTTP服务

yum install httpd
systemctl enable httpd
systemctl start httpd
登录后复制

提前下载并放置安装包

请提前下载以下安装包,并将其放置在HTTP服务的/var/www/html/compile-ambari目录下(新建compile-ambari目录):

  • hadoop-3.1.1.tar.gz
  • hbase-2.0.2.tar.gz
  • grafana-6.7.4.linux-amd64.tar.gz
  • apache-phoenix-5.0.0-HBase-2.0-bin.tar.gz

源码下载与修改

wget https://mirrors.tuna.tsinghua.edu.cn/apache/ambari/ambari-2.7.6/apache-ambari-2.7.6-src.tar.gz
tar zxvf apache-ambari-2.7.6-src.tar.gz
cd apache-ambari-2.7.6-src
登录后复制

修改主目录下的pom文件,添加HDP仓库:

<repository>
    <releases>
        <enabled>true</enabled>
        <updatePolicy>always</updatePolicy>
        <checksumPolicy>warn</checksumPolicy>
    </releases>
    <snapshots>
        <enabled>false</enabled>
        <updatePolicy>never</updatePolicy>
        <checksumPolicy>fail</checksumPolicy>
    </snapshots>
    <id>HDPReleases</id>
    <name>HDP Releases</name>
    <url>https://repo.hortonworks.com/content/repositories/releases/</url>
    <layout>default</layout>
</repository>
登录后复制

修改ambari-metrics/pom.xml文件,将hbase、hadoop以及grafana的下载地址替换为本地地址:

<hbase.tar>http://localhost/compile-ambari/hbase-2.0.2-bin.tar.gz</hbase.tar>
<hadoop.tar>http://localhost/compile-ambari/hadoop-3.1.1.tar.gz</hadoop.tar>
<grafana.tar>http://localhost/compile-ambari/grafana-6.7.4.linux-amd64.tar.gz</grafana.tar>
<phoenix.tar>http://localhost/compile-ambari/apache-phoenix-5.0.0-HBase-2.0-bin.tar.gz</phoenix.tar>
登录后复制

执行编译

mvn clean install rpm:rpm -DskipTests
登录后复制

完成上述步骤后,您将得到编译结果:

ambari 2.7.6源码编译指南

问题与解决方法

如果在编译过程中遇到如下问题:

[INFO] [2/4] Fetching packages...
[ERROR] warning fsevents@2.3.2: The platform "linux" is incompatible with this module.
[INFO] info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[INFO] [3/4] Linking dependencies...
[INFO] [4/4] Building fresh packages...
[INFO] info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[ERROR] error /root/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/phantomjs: Command failed.
[ERROR] Exit code: 1
[ERROR] Command: sh
[ERROR] Arguments: -c node install.js
[ERROR] Directory: /root/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/phantomjs
[ERROR] Output:
[ERROR] PhantomJS not found on PATH
[ERROR] Download already available at /tmp/npm_config_tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
[ERROR] Verified checksum of previously downloaded file
[ERROR] Extracting tar contents (via spawned process)
[ERROR] Removing /root/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/phantomjs/lib/phantom
[ERROR] Copying extracted folder /tmp/npm_config_tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1639887716005/phantomjs-2.1.1-linux-x86_64 -> /root/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/phantomjs/lib/phantom
[ERROR] Install exited unexpectedly
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Ambari Main 2.7.6.0.0 .............................. SUCCESS [  3.717 s]
[INFO] Apache Ambari Project POM 2.7.6.0.0 ................ SUCCESS [  0.195 s]
[INFO] Ambari Web 2.7.6.0.0 ............................... SUCCESS [01:43 min]
[INFO] Ambari Views 2.7.6.0.0 ............................. SUCCESS [  6.583 s]
[INFO] Ambari Admin View 2.7.6.0.0 ........................ FAILURE [ 47.472 s]
[INFO] ambari-utility 1.0.0.0-SNAPSHOT .................... SKIPPED
[INFO] ambari-metrics 2.7.6.0.0 ........................... SKIPPED
[INFO] Ambari Metrics Common 2.7.6.0.0 .................... SKIPPED
登录后复制

请将/tmp/npm_config_tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1639887716005/phantomjs-2.1.1-linux-x86_64目录下的所有内容复制到/root/ambari/ambari-admin/src/main/resources/ui/admin-web/node_modules/phantomjs/lib/phantom目录下,然后重新执行编译命令。

本文由大数据到人工智能博主「xiaozhch5」原创,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。

原文链接:https://www.php.cn/link/6f5e6653c2100f36ef017088363ea359

以上就是ambari 2.7.6源码编译指南的详细内容,更多请关注php中文网其它相关文章!

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号