1、准备工做:
1.基本工具
yum
rpm
scp
curl
wget
pdsh
前几个通常系统都自带了,pdsh须要本身装 : yum install pdsh
这个命令没有成功执行 本身下载pdsh.tar.bz2,用tar -jxvf filename.tar.bz解压。以后进入filename文件夹,执行./configure,而后执行make和make install命令。安装结束。html
另:使用yum install pdsh没有成功的问题安装epel便可解决。epel是一个提供高质量软件包的项目。安装过程以下:
1.查看是否安装:rpm -q epel-release
2.若没有,使用rpm命令安装:rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm(也可手动下载安装包安装)
3.成功后查看其所依附的软件包:rpm -qR epel-release
4.导入key:rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
5.安装yum-priority:yum install yum-priorities
6.cd /etc/yum.repos.d
ls |grep epel
7.安装pdsh便可:yum install pdshpython
ambari文档上说“The Python version shipped with SUSE 11, 2.6.0-8.12.2, has a critical bug that may cause the Ambari Agent to fail with 24 hours. If you are installing on
SUSE 11, please update all your hosts to Python version 2.6.8-0.15.1.”
使用yum update python命令更新python版本。linux
2.分别配置/etc/hosts和/etc/sysconfig/network
以ambari节点下修改hosts文件为例:(本机192.168.235.138,master节点ip地址为192.168.235.139,slave节点ip地址为192.168.235.140)数据库
127.0.0.1 ambari
::1 ambariapache
192.168.235.139 master
192.168.235.140 slavecentos
(修改主机名,好比改成ambari:
hostname ambari
vi /etc/sysconfig/network 在里面设置ambari
没必要重启)api
3.设置免密码登录:
[root@ambari ~]# ssh-keygen
[root@ambari ~]# cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[root@ambari ~]# scp ~/.ssh/authorized_keys master:/root/.ssh/
[root@ambari ~]# scp ~/.ssh/authorized_keys slave:/root/.ssh/浏览器
4.关闭SELinux:
暂时关闭命令:setenforce 0
永久关闭命令:vi /etc/selinux/config
将其中的SELinux设置:为SELINUX=disabledssh
5.关闭防火墙:
永久关闭:chkconfig iptables off
关闭:/etc/init.d/iptables stop
(也可在setup中设置开机不开启防火墙)curl
6.设置关闭packagekit
vi /etc/yum/pluginconf.d/refresh-packagekit.conf
将enabled设为0
7. Optional: Configure the Local Repositorie(没有联网,或者配置很大的集群并想保持带宽)
参考:http://ambari.apache.org/1.2.2/installing-hadoop-using-ambari/content/ambari-chap1-6.html
2、安装
1.下载repo文件
wget http://public-repo-1.hortonworks.com/ambari/centos6/1.x/GA/ambari.repo
cp ambari.repo /etc/yum.repos.d
2.安装epel repository
yum install epel-release
查看是否配置成功,命令:
yum repolist
若成功,则应显示(不一样系统可能稍有不一样):
repo id repo name status
HDP-UTILS-1.1.0.16 Hortonworks Data Platform Utils Version - HDP-UTILS-1. 61
Updates-ambari-1.x ambari-1.x - Updates 65
ambari-1.x Ambari 1.x 5
base CentOS-6 - Base 6,367
epel Extra Packages for Enterprise Linux 6 - x86_64 10,633
extras CentOS-6 - Extras 14
updates CentOS-6 - Updates 0
repolist: 17,145
以后安装ambari bits:
yum install ambari-server
这个命令同时安装了PostgreSQL。
3.执行命令:ambari-server setup
若是尚未关闭SELinux,执行这个命令的过程当中会提示,选择y。而后会配置PostgreSQL,选择y自动下载安装jdk。以后配置数据库,选n使用默认数据库用户名ambari-server和密码bigdata,选y本身建立用户名密码。
执行命令ambari-server start启动服务。在浏览器中输入“主机名:8080”进入登录界面,默认用户名密码为admin/admin。
能够修改端口号:
在/etc/ambari-server/conf/ambari.properties文件增长
client.api.port=<port_number>
查看ambari进程:ps -ef | grep Ambari中止ambari进程:ambari-server stop重启ambari进程:ambari-server restart