CentOS6.5下安裝Ambari

 

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

相關文章
相關標籤/搜索