安装ambari有两种方式,一是自己下载源码编译,另外一个是使用公共仓库

1 使用Public Respositories

Step1: Download the Ambari repository on the Ambari Server host

For Redhat/CentOS/Oracle:
  cd /etc/yum.repos.d/
  wget <ambari-repo-url>
 
For SUSE:
  cd /etc/zypp/repos.d
  wget <ambari-repo-url>
 
For Ubuntu:
  cd /etc/apt/sources.list.d
  wget <ambari-repo-url>

Choose an appropriate <ambari-repo-url> based on the platform used:

Step 2: Install, Setup, and Start Ambari Server

Install Ambari Server from the public Ambari repository:

For Redhat/CentOS/Oracle:
  yum install ambari-server
 
For SUSE:
  zypper install ambari-server
 
For Ubuntu:
  apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B9733A7A07513CAD
  apt-get update
  apt-get install ambari-server

Run the setup command to configure your Ambari Server, Database, JDK, LDAP, and other options:

ambari-server setup

Start Ambari Server:

ambari-server start

Step 3: Deploy Cluster using Ambari Web UI

Open up a web browser and go to http://<ambari-server-host>:8080.

Log in with username admin and password admin and follow on-screen instructions.

2 自己下载源码编译

Step 1: Download and build Ambari 2.1.0 source

Go to http://www.apache.org/dyn/closer.cgi/ambari/ambari-2.1.0 and find the suggested mirror for download. The process to verify the download is described is at http://www.apache.org/dyn/closer.cgi#verify

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

Note: If running into errors while compiling the ambari-metrics package due to missing the artifacts of jms, jmxri, jmxtools:

[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.1.0-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

The work around is to manually install the three missing artifacts:

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

The three poms are:

$ 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.1.0 -DskipTests -Dpython.ver="python >= 2.6"

Ubuntu:

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

Note: You need to have tools such as rpm-build tool, brunch, etc.  For details on prerequisites, please see Ambari Development.

Step 2: Install Ambari Server

Install the rpm package from ambari-server/target/rpm/ambari-server/RPMS/noarch/

[For CentOS 5 or 6]

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

[For SLES 11]

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

[For Ubuntu 12]

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

Step 3: Setup and Start Ambari Server

Run the setup command to configure your Ambari Server, Database, JDK, LDAP, and other options:

ambari-server setup

Follow the on-screen instructions to proceed.

Once set up is done, start Ambari Server:

ambari-server start

Step 4: Install and Start Ambari Agent on All Hosts

Note: This step needs to be run on all hosts that will be managed by Ambari.

Copy the rpm package from ambari-agent/target/rpm/ambari-agent/RPMS/x86_64/ and run:

[For CentOS 5 or 6]

yum install ambari-agent*.rpm

[For SLES 11]

zypper install ambari-agent*.rpm

[For Ubuntu 12]

apt-get install ambari-agent*.rpm

Edit /etc/ambari-agent/ambari.ini

...
[server]
hostname=localhost
 
...

Make sure hostname under the [server] section points to the actual Ambari Server host, rather than "localhost".

ambari-agent start

Step 5: Deploy Cluster using Ambari Web UI

Open up a web browser and go to http://<ambari-server-host>:8080.

Log in with username admin and password admin and follow on-screen instructions. Secure your environment by ensuring your administrator details are changed from the default values as soon as possible.

Under Install Options page, enter the hosts to add to the cluster.  Do not supply any SSH key, and check "Perform manual registration on hosts and do not use SSH" and hit "Next".

第一种方式比较简单,但是下载Ambari花了很长时间

第二种方式比较复杂,编译过程中会遇到各种问题,包括安装NodeJS,安装Brunch....等等

 

参考:

https://cwiki.apache.org/confluence/display/AMBARI/Build+and+install+Ambari+2.1.0+from+Source

https://cwiki.apache.org/confluence/display/AMBARI/Ambari+Development

https://cwiki.apache.org/confluence/display/AMBARI/Install+Ambari+2.1.0+from+Public+Repositories

http://www.sxt.cn/u/756/blog/5423

最新文章

  1. java并发编程(十八)阻塞队列和阻塞栈
  2. Lesson 1 A private conversation
  3. 使用RelativeLayout控制WebView以及Bottom按钮的位置
  4. SNS网站成功原因剖析_完结
  5. Spark MLlib - Decision Tree源码分析
  6. cocos2d 中加入显示文字的三种方式(CCLabelTTF 、CCLabelBMFont 和CCLabelAtlas)
  7. UML类图标识
  8. css属性之box-shadow
  9. 作业还是作孽?——Leo鉴书79
  10. 详解k8s零停机滚动发布微服务 - kubernetes
  11. 【作业3.0】HansBug的第三次博客规格总结
  12. LeetCode算法题-Degree of an Array(Java实现)
  13. Centos7 启动脚本
  14. CentOS防火墙配置
  15. NSArray与NSString、NSData,NSDictionary与NSString、NSData 相互转化
  16. CPU 架构 —— ARM 架构
  17. mysql函数的使用
  18. @Resource和@Autowired区别
  19. python将字符转换为字典
  20. 【Leetcode】771. Jewels and Stones

热门文章

  1. [spring源码] 小白级别的源码解析IOC容器的依赖注入(三)
  2. 二十一. Python基础(21)--Python基础(21)
  3. @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) 注解的作用
  4. Nginx源代码安装
  5. 第一个Spring 程序
  6. servlet邮箱激活验证实例含代码
  7. nodejs --- formidable模块 , post 上传.
  8. 分布式队列celery 异步----Django框架中的使用
  9. 转载 单例(Singleton)模式)的误区
  10. Python之os模块和sys模块