Yun2集羣上Ambari+HDP安裝html
1.安裝環境說明:python
系統版本:CentOS7linux
安裝版本:sql
Ambari版本:2.2.2.0數據庫
HDP版本:2.4.2.0centos
集羣機器:瀏覽器
Ambari Server :yun2服務器
Ambari Agent:yun3 ,yun4,yun6,yun18,yun19,yun20,yun21ssh
2.操做系統環境準備ide
2.1 配置SSH免密碼登陸
主節點裏root用戶登陸執行以下步驟:
ssh-keygen –t rsa
cd /root/.ssh
cat id_rsa.pub >>authorized_keys
分發主節點裏配置好的authorized_keys到各從節點:
scp -r /root/.ssh/authorized_keys yun3,: /root/.ssh/authorized_keys
scp -r /root/.ssh/authorized_keys yun4,: /root/.ssh/authorized_keys
scp -r /root/.ssh/authorized_keys yun6,: /root/.ssh/authorized_keys
scp -r /root/.ssh/authorized_keys yun18,: /root/.ssh/authorized_keys
scp -r /root/.ssh/authorized_keys yun19,: /root/.ssh/authorized_keys
scp -r /root/.ssh/authorized_keys yun20,: /root/.ssh/authorized_keys
scp -r /root/.ssh/authorized_keys yun21,: /root/.ssh/authorized_keys
2.2 建立ambari系統用戶和用戶組
只在主節點操做
添加ambari安裝、運行用戶和用戶組,也能夠不建立新用戶,直接使用root或者系統其餘帳號
useradd admin
passwd admin
2.3 開啓NTP服務
全部集羣上節點都須要操做
yum install ntp
systemctl is-enabled ntpd
systemctl enable ntpd
systemctl start ntpd
2.4 關閉防火牆
全部節點都要設置
systemctl disable firewalld
systemctl stop firewalld
2.5 關閉SELinux
全部節點都要設置
查看SELinux狀態:
sestatus
若是SELinux status參數爲enabled即爲開啓狀態
SELinux status: enabled
臨時關閉,不用重啓機器:
setenforce 0
修改配置文件須要重啓機器:
vi /etc/sysconfig/selinux SELINUX=disabled
3.製做本地源
製做本地源只需在主節點上進行便可
3.1 相關準備工做
3.1.1安裝 Apache HTTP 服務器
安裝HTTP 服務器,容許 http 服務經過防火牆(永久)
yum install httpd
firewall-cmd --add-service=http
firewall-cmd --permanent --add-service=http
添加 Apache 服務到系統層使其隨系統自動啓動
systemctl start httpd.service
systemctl enable httpd.service
3.1.2 安裝本地源製做相關工具
下載 Ambari 2.2.2 , HDP 2.4.2 的安裝資源,本次安裝是在Centos 7 上,只列出centos7的資源,其餘系統的請如今對用系統的資源,不一樣版本資源請上http://docs.hortonworks.com/index.html上查找
Ambari 2.2.2 下載資源
OSFormatURL
CentOS 7Base URLhttp://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.2.2.0
CentOS 7Repo Filehttp://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.2.2.0/ambari.repo
CentOS 7Tarball md5 aschttp://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.2.2.0/ambari-2.2.2.0-centos7.tar.gz
HDP 2.4.2 下載資源
OSRepository NameFormatURL
CentOS 7HDPBase URLhttp://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.4.2.0
CentOS 7HDPRepo Filehttp://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.4.2.0/hdp.repo
CentOS 7HDPTarball md5 aschttp://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.4.2.0/HDP-2.4.2.0-centos7-rpm.tar.gz
CentOS 7HDP-UTILSBase URLhttp://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos7
CentOS 7HDP-UTILSRepo Filehttp://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos7/HDP-UTILS-1.1.0.20-centos7.tar.gz
須要下載的壓縮包以下:
Ambari 2.2.2 http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.4.0.0/HDP-2.4.0.0-centos7-rpm.tar.gz
HDP 2.4.2 http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.2.2.0/ambari-2.2.2.0-centos7.tar.gz
HDP-UTILS 1.1.0 http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos7/HDP-UTILS-1.1.0.20-centos7.tar.gz
在httpd網站根目錄,默認是即/var/www/html/,
cd /var/www/html/
根據版本建立目錄:Ambari2.2.2.0-HDP2.4.2.0
mkdir Ambari2.2.2.0-HDP2.4.2.0
進入/var/www/html/ambari/
cd /var/www/html/ambari/
將下載的壓縮包解壓到/var/www/html/ Ambari2.2.2.0-HDP2.4.2.0目錄
tar -zxvf ambari-2.2.2.0-centos7.tar.gz
tar -zxvf HDP-2.4.2.0-centos7-rpm.tar.gz
tar -zxvf HDP-UTILS-1.1.0.20-centos7.tar.gz
驗證httd網站是否可用,可使用瀏覽器直接訪問下面的地址:
HTTP://192.168.1.202/Ambari2.2.2.0-HDP2.4.2.0
3.3 配置ambari、HDP、HDP-UTILS的本地源
首先下載上面資源列表中的相應repo文件,修改其中的URL爲本地的地址,相關配置以下:
ambari.repo:
#VERSION_NUMBER=2.2.2.2.0
[ambari-2.2.2.0]
name=ambari Version - ambari-2.2.2.0
baseurl=http://192.168.1.202/Ambari2.2.2.0-HDP2.4.2.0/AMBARI-2.2.2.0/centos7/2.2.2.0-460
gpgcheck=1
gpgkey=http://192.168.1.205/Ambari2.2.2.0-HDP2.4.2.0/AMBARI-2.2.2.0/centos7/2.2.2.0-460/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
hdp.repo:
#VERSION_NUMBER=2.4.2.0-258
[HDP-2.4.2.0]
name=HDP Version - HDP-2.4.2.0
baseurl=http://192.168.1.202/Ambari2.2.2.0-HDP2.4.2.0/HDP/centos7/2.x/updates/2.4.2.0
gpgcheck=1
gpgkey=http://192.168.1.202/Ambari2.2.2.0-HDP2.4.2.0/HDP/centos7/2.x/updates/2.4.2.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
[HDP-UTILS-1.1.0.20]
name=HDP Utils Version - HDP-UTILS-1.1.0.20
baseurl=http://192.168.1.202/Ambari2.2.2.0-HDP2.4.2.0/HDP-UTILS-1.1.0.20/repos/centos7
gpgcheck=1
gpgkey=http://192.168.1.202/Ambari2.2.2.0-HDP2.4.2.0/HDP-UTILS-1.1.0.20/repos/centos7/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
將上面的修改過的源放到/etc/yum.repos.d/下面
yum clean all
yum list update
yum makecache
yum repolist
4.進行安裝Ambari
4.1 安裝Ambari2.2.2
4.1.1安裝Ambari
yum install ambari-server
若是報錯,提示:
Error: Package: ambari-server-2.2.2.0-460.x86_64 (ambari-2.2.2.0)
Requires: postgresql-server >= 8.1
緣由是postgresql沒有安裝或版本過低,將Postgresql相關RPM安裝包拷入倉庫中,而後安裝
yum install postgresql-devel-9.2.7-1.el7.x86_64.rpm
yum install postgresql-server-9.2.7-1.el7.x86_64.rpm
yum install postgresql-9.2.7-1.el7.x86_64.rpm
以後再安裝Ambari
yum install postgresql-9.2.7-1.el7.x86_64.rpm
4.1.2配置Ambari
ambari-server setup
下面是配置執行流程,按照提示操做
1.檢查SELinux是否關閉,輸入y:
Using python /usr/bin/python
Setup ambari-server
Checking SELinux...
SELinux status is 'disabled'
WARNING: SELinux is set to 'permissive' mode and temporarily disabled.
OK to continue [y/n] (y)? y
2.提示是否自定義設置。輸入:y
Customize user account for ambari-server daemon [y/n] (n)? y
3.ambari-server 帳號。直接回車
Enter user account for ambari-server daemon (root):
Adjusting ambari-server permissions and ownership...
4.檢查防火牆,若是關閉則不用操做
Checking firewall status...
Redirecting to /bin/systemctl status iptables.service
5.設置JDK。輸入:3 ,自定義JDK
Checking JDK...
Checking JDK...
[1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8
[2] Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7
[3] Custom JDK
==============================================================================
Enter choice (1): 3
6.若是上面選擇3自定義JDK,則須要設置JAVA_HOME。輸入:/usr/local/jdk
WARNING: JDK must be installed on all hosts and JAVA_HOME must be valid on all hosts.
WARNING: JCE Policy files are required for configuring Kerberos security. If you plan to use Kerberos,please make sure JCE Unlimited Strength Jurisdiction Policy Files are valid on all hosts.
Path to JAVA_HOME: /usr/local/jdk Validating JDK on Ambari Server...done. Completing setup...
7.數據庫配置。選擇:y
Configuring database... Enter advanced database configuration [y/n] (n)? y
8.選擇數據庫類型。輸入:1 ,Ambari內置PostgreSQL數據庫
Configuring database... ==============================================================================
Choose one of the following options:
[1] - PostgreSQL (Embedded)
[2] - Oracle
[3] - MySQL
[4] – PostgreSQL
[5] - Microsoft SQL Server (Tech Preview)
[6] - SQL Anywhere
==============================================================================
Enter choice (1): 1
9.設置數據庫的具體配置信息,根據實際狀況輸入,若是和括號內相同,則能夠直接回車。
Hostname (localhost):
Port ():
Database name (ambari):
Username (ambari):ambari
Enter Database Password (bigdata):ambari
4.1.3啓動Amabri
執行啓動命令,啓動Ambari服務
ambari-server start
成功啓動後在瀏覽器輸入Ambari地址:
http://192.168.1.202:8080/
出現登陸界面,默認管理員帳戶登陸, 帳戶:admin 密碼:admin
登陸成功後出現下面的界面,至此Ambari的安裝成功
4.2 安裝安裝HDP 2.4.2 配置集羣
點擊上面登陸成功頁面的Launch Install Wizard 按鈕進行集羣配置
4.2.1設置集羣名稱
4.2.2設置HDP 安裝源
選擇HDP2.4 ,而且設置Advanced Repository Options 的信息,本次使用本地源,因此修改對用系統的安裝源爲本地源地址。
4.2.3設置集羣機器
4.2.4 Host 確認
確認前面配置集羣中hosts列表 中的機器是否均可用,也能夠移除相關機器,集羣中機器Success後進行下一步操做。
4.2.5 選擇要安裝的服務
4.2.6各個服務Master配置
4.2.6 服務的Slaves 和 Clients節配置
4.2.7 服務的客製化配置
其中Ambari Metrics中的Grafana Admin Password必需要在初始化時設置:密碼設置爲:grafana
HIVE的METASTORE DATAABSE的DATABASE Password也必須設置,設置爲:hive
4.2.8 顯示配置信息
4.2.9開始安裝
安裝各個服務,而且完成安裝後會啓動相關服務,安裝過程比較長,若是中途出現錯誤,請根據具體提示或者log進行操做。
所有安裝成功界面以下