Apache Ambari 2.4.2 安装指南

本文档详细介绍了如何编译和安装Apache Ambari 2.4.2,包括下载源代码、安装服务器、配置启动、部署Ambari代理以及通过Web UI创建集群。在安装过程中提到了解决依赖问题和确保安全性的注意事项。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

编译并安装 Ambari 2.4.2,编译前的开发环境准备

第1步:下载并构建Ambari 2.4.2源

转到镜像文件地址并找到建议的镜像下载。验证下载的过程描述在下载过程验证

wget http://www.apache.org/dist/ambari/ambari-2.4.2/apache-ambari-2.4.2-src.tar.gz (使用上面建议的镜像)
tar xfvz apache-ambari-2.4.2-src.tar.gz
cd apache-ambari-2.4.2-src
mvn versions:set -DnewVersion=2.4.2.0.0

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

Note: 如果因为缺少jms,jmxri,jmxtools等工具导致编译ambari-metrics包时产生错误:

[ERROR] Failed to execute goal on project ambari-metrics-kafka-sink: Could not resolve dependencies for project org.apache.ambari:ambari-metrics-kafka-sink:jar:2.2.2-0: The following artifacts could not be resolved: javax.jms:jms:jar:1.1, com.sun.jdmk:jmxtools:jar:1.2.1, com.sun.jmx:jmxri:jar:1.2.1: Could not transfer artifact javax.jms:jms:jar:1.1 from/to java.net (https://maven-repository.dev.java.net/nonav/repository): No connector available to access repository java.net (https://maven-repository.dev.java.net/nonav/repository) of type legacy using the available factories WagonRepositoryConnectorFactory

解决方法是手动安装缺少的这三个工具:

mvn install:install-file -Dfile=jms-1.1.pom -DgroupId=javax.jms -DartifactId=jms -Dversion=1.1 -Dpackaging=jar

mvn install:install-file -Dfile=jmxtools-1.2.1.pom -DgroupId=com.sun.jdmk -DartifactId=jmxtools -Dversion=1.2.1 -Dpackaging=jar

mvn install:install-file -Dfile=jmxri-1.2.1.pom -DgroupId=com.sun.jmx -DartifactId=jmxri -Dversion=1.2.1 -Dpackaging=jar

这三个工具的pom如下:

$ cat jms-1.1.pom
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>javax.jms</groupId>
  <artifactId>jms</artifactId>
  <version>1.1</version>
  <name>Java Message Service</name>
  <description>
    The Java Message Service (JMS) API is a messaging standard that allows application components based on the Java 2 Platform, Enterprise Edition (J2EE) to create, send, receive, and read messages. It enables distributed communication that is loosely coupled, reliable, and asynchronous.
  </description>
  <url>http://java.sun.com/products/jms</url>
  <distributionManagement>
    <downloadUrl>http://java.sun.com/products/jms/docs.html</downloadUrl>
  </distributionManagement>
$ cat jmxri-1.2.1.pom
<?xml version="1.0" encoding="UTF-8"?><project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.sun.jmx</groupId>
  <artifactId>jmxri</artifactId>
  <version>1.2.1</version>
  <distributionManagement>
    <status>deployed</status>
  </distributionManagement>
$ cat jmxtools-1.2.1.pom
<?xml version="1.0" encoding="UTF-8"?><project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.sun.jdmk</groupId>
  <artifactId>jmxtools</artifactId>
  <version>1.2.1</version>
  <distributionManagement>
    <status>deployed</status>
  </distributionManagement>

RHEL (CentOS 5 or 6) & SUSE (SLES 11):

mvn -B clean install package rpm:rpm -DnewVersion=2.4.2.0.0 -DskipTests -Dpython.ver="python >= 2.6"

Ubuntu/Debian:

mvn -B clean install package jdeb:jdeb -DnewVersion=2.4.2.0.0 -DskipTests -Dpython.ver="python >= 2.6"

Note: 你需要有工具,如rpm-build和brunch等工具。 关先决条件的详细信息,请参阅 Ambari 开发环境.

第2步:安装Ambari服务器

ambari-server/target/rpm/ambari-server/RPMS/noarch/安装rmp包

[CentOS 5 or 6]

yum install ambari-server*.rpm    #This should also pull in postgres packages as well.

[SUSE(SLES) 11]

zypper install ambari-server*.rpm    #This should also pull in postgres packages as well.

[Ubuntu/Debian]

apt-get install ambari-server*.deb   #This should also pull in postgres packages as well.

第3步:设置和启动Ambari服务器

运行setup命令配置Ambari服务器,数据库,JDK,LDAP和其他选项:

ambari-server setup

按照屏幕上的说明继续操作。一旦设置完成,启动Ambari服务器:

ambari-server start

第4步:在所有主机上安装和启动Ambari代理

Note: 此步骤需要在将由Ambari管理的所有主机上运行。

ambari-agent / target / rpm / ambari-agent / RPMS / x86_64 /中复制rpm软件包并运行:

[CentOS 5 or 6]

yum install ambari-agent*.rpm

[SUSE(SLES) 11]

zypper install ambari-agent*.rpm

[Ubuntu/Debian]

apt-get install ambari-agent*.rpm

编辑 /etc/ambari-agent/ambari.ini
确保[server]下的主机名指向实际的Ambari服务器主机,而不是“localhost”

...
[server]
hostname=localhost

...
ambari-agent start

第5步: 使用Ambari Web UI部署集群

打开Web浏览器并转到http:// <ambari-server-host>:8080

使用admin的用户名和密码登录,并按照屏幕上的说明。尽快确保管理员的详细信息不是默认值从而保护运行环境。

在“安装选项”页面下,输入要添加到群集的主机。不要提供任何SSH密钥,并选中“在主机上执行手动注册,而不使用SSH”,然后单击“下一步”。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值