本文通过查阅互联网上现存关于Ambari安装与使用 教程并通过实践,对此过程的记录与补充而来,希望会对您有所帮助:)
Apache Ambari是对Hadoop进行监控、管理和生命周期管理的开源项目。它也是一个为Hortonworks数据平台选择管理组建的项目。Ambari向Hadoop MapReduce、HDFS、 HBase、Pig, Hive、HCatalog以及Zookeeper提供服务。
一、准备工作
1、系统:我的系统是CentOS6.3,x86_64,本次集群采用4个节点。管理节点:192.168.1.70;客户端节点:192.168.1.71,192.168.1.72,192.168.1.73
2、系统最好配置能上网,这样方便后面的操作,否则需要配置yum仓库,比较麻烦。
3、集群中ambari-serveer(管理节点)到客户端配置无密码登录。
4、集群同步时间
5、SELinux,iptables都处于关闭状态。
6、ambari版本:1.2.0
二、安装步骤
A、配置基础集群环境
############ 配置无密码登录[已配置集群ssh请忽略此项] #################
[root@Master ~]# ssh-keygen -t rsa
[root@Master ~]# cat /root/.ssh/id_dsa.pub >> /root/.ssh/authorized_keys
[root@Master ~]# scp /root/.ssh/id_dsa.pub 192.168.1.71:/root/
[root@Master ~]# ssh 192.168.1.71
[root@Slave1 ~]# cat /root/.ssh/id_dsa.pub >> /root/.ssh/authorized_keys
############# NTP 时间同步 #################
[root@Master ~]# ntpdate time.windows.com
[root@Master ~]# ssh 192.168.1.71 ntpdate time.windows.com
########### SELinux & iptables 关闭 ###########
[root@Master ~]# setenforce 0
[root@Master ~]# ssh 192.168.1.71 setenforce 0
[root@Master ~]# chkconfig iptables off
[root@Master ~]# service iptables stop
[root@Master ~]# ssh 192.168.1.71 chkconfig iptables off
[root@Master ~]# ssh 192.168.1.71 service iptables stop
# 以上仅列出一个配置实例,其他节点的操作也按照:192.168.1.71(Slave1)方法 #
B、管理节点上安装ambari-server
1、下载repo文件
[root@Master ~]# wget http://public-repo-1.hortonworks.com/AMBARI-1.x/repos/centos6/ambari.repo
[root@Master ~]# cp ambari.repo /etc/yum.repos.d
2、安装epel仓库
# 注:在安装过程中需要确认操作,都选择y
[root@Master ~]# yum install epel-release
# 查看仓库列表,应该有HDP,EPEL
[root@Master ~]# yum repolist
3、通过yum安装amabari bits,这同时也会安装PostgreSQL
[root@Master ~]# yum install ambari-server
这个步骤要等一会,它需要上网下载,大概39M左右。
4、安装ambari-server
[root@Master ~]# ambari-server setup –j /my/jdk/home
指定本机jdk路径并自动安装配置PostgreSQL,同时要求输入用户名和密码,如果按n,它用默认的用户名/密码值:ambari-server/bigdata。安装完成后,ambari-server就可以启动了(命令:ambari-server start)。
注: 如果使用不带参数的命令[ambari-server setup]运行,会默认下载oracle-jdk-1.6,按理说,我们既然已经搭建好了hadoop集群,那在搭建hadoop集群前jdk就是必须的,所以此处应该指定本机jdk安装路径,以免多此一举。
三、集群启动
1、直接接通过ambari-server start和amabari-server stop即可启动和关闭ambari-serveer。2、启动成功后,在浏览器输入http://192.168.1.70:8080
界面如下图所示:
![](http://static.oschina.net/uploads/space/2013/0602/155846_yMPx_131681.png)
登录名和密码都是admin,这样就可以登录到管理控制台。
![](http://static.oschina.net/uploads/space/2013/0602/160028_HxHj_131681.png)
参考自:http://blog.csdn.net/dyllove98/article/details/8644233