ambari 2.7.6源码编译指南

本文涉及的产品
可观测可视化 Grafana 版,10个用户账号 1个月
简介: 2021/11/16,ambari终于推出了2.7.6版本,该版本相对2.7.5版本以来,共有26个contributors提交了114个commits以及修改了557个文件。本文以ambari最新版本源码,分享如何进行ambari源码编译以及编译过程中遇到的坑。

编译环境与基本软件安装

  • centos 7.6
  • maven 3.6.3

由于编译相关jar包较难下载,所以本文提供仅用于ambari编译的maven repository,将该repository替换原.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

提前下载如下安装包

  • 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

并将其放置到http服务的/var/www/html/compile-ambari目录下(新建compile-ambari目录)

源码下载与修改

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 

便可得到:

请添加图片描述

问题与解决方法

如果出现如下问题:

[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目录下,重新执行即可

相关文章
|
5月前
|
监控 程序员 Linux
supervisor的正确离线安装和使用
supervisor的正确离线安装和使用
239 0
|
2月前
|
关系型数据库 MySQL Linux
Azkaban【部署 02】CentOS release 7.5安装配置azkaban-3.70.0安装阶段(含已编译的10个安装文件:可直接进行安装)
【2月更文挑战第5天】CentOS release 7.5安装配置azkaban-3.70.0安装阶段(含已编译的10个安装文件:可直接进行安装)
48 7
|
7月前
|
监控 Ubuntu Python
Supervisor离线安装及使用
Supervisor是用Python开发的一套通用的进程管理程序,能将一个普通的命令行进程变为后台daemon,并监控进程状态,异常退出时能自动重启。它是通过fork/exec的方式把这些被管理的进程当作supervisor的子进程来启动,这样只要在supervisor的配置文件中,把要管理的进程的可执行文件的路径写进去即可。也实现当子进程挂掉的时候,父进程可以准确获取子进程挂掉的信息的,可以选择是否自己启动和报警
128 0
|
9月前
|
监控 Unix 程序员
正确离线安装supervisor
supervisor是一个用python语言编写的进程管理工具,它可以很方便的监听、启动、停止、重启一个或多个进程。当一个进程意外被杀死,supervisor监听到进程死后,可以很方便的让进程自动恢复,不再需要程序员或系统管理员自己编写代码来控制。
335 0
|
9月前
|
关系型数据库 MySQL Java
安装Ambari和HDP
安装Ambari和HDP
203 1
|
SQL 分布式数据库 HIVE
ambari卸载
ambari卸载
243 0
|
分布式计算 Java Maven
在centos7下编译ambari 2.7
安装docker虚拟化工具,与配套的weave等网络工具,其中weave建议放置于/usr/bin下,避免使用sudo权限运行时提示找不到命令
385 0
在centos7下编译ambari 2.7
|
监控 Linux 网络安全
离线安装supervisor
内、外网环境都可以使用
529 0
|
Web App开发 监控 关系型数据库
|
监控 大数据 Apache