溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

ambari+hdp安裝

發(fā)布時(shí)間:2020-08-01 00:24:10 來源:網(wǎng)絡(luò) 閱讀:3089 作者:choulanlan 欄目:建站服務(wù)器

Yun2集群上Ambari+HDP安裝


1. 安裝環(huán)境說明:

系統(tǒng)版本:CentOS7

安裝版本:

Ambari版本:2.2.2.0

HDP版本:2.4.2.0

集群機(jī)器:

Ambari Server :yun2

Ambari Agent:yun3 ,yun4,yun6,yun18,yun19,yun20,yun21

2. 操作系統(tǒng)環(huán)境準(zhǔn)備

2.1 配置SSH免密碼登錄

主節(jié)點(diǎn)里root用戶登錄執(zhí)行如下步驟:

ssh-keygen –t rsa

cd /root/.ssh

cat id_rsa.pub >>authorized_keys


分發(fā)主節(jié)點(diǎn)里配置好的authorized_keys到各從節(jié)點(diǎn):

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 創(chuàng)建ambari系統(tǒng)用戶和用戶組

只在主節(jié)點(diǎn)操作

添加ambari安裝、運(yùn)行用戶和用戶組,也可以不創(chuàng)建新用戶,直接使用root或者系統(tǒng)其他賬號(hào)

useradd admin

passwd admin

2.3 開啟NTP服務(wù)  

所有集群上節(jié)點(diǎn)都需要操作  

yum install ntp 

systemctl is-enabled ntpd

systemctl enable ntpd

systemctl start ntpd

2.4 關(guān)閉防火墻  

所有節(jié)點(diǎn)都要設(shè)置

systemctl disable firewalld 

systemctl stop firewalld


2.5 關(guān)閉SELinux  

所有節(jié)點(diǎn)都要設(shè)置  

查看SELinux狀態(tài):  

sestatus 

如果SELinux status參數(shù)為enabled即為開啟狀態(tài)  

SELinux status: enabled  

臨時(shí)關(guān)閉,不用重啟機(jī)器:  

setenforce 0 

修改配置文件需要重啟機(jī)器:  

vi /etc/sysconfig/selinux SELINUX=disabled

3.制作本地源 

制作本地源只需在主節(jié)點(diǎn)上進(jìn)行即可  

3.1 相關(guān)準(zhǔn)備工作  

3.1.1安裝 Apache HTTP 服務(wù)器

安裝HTTP 服務(wù)器,允許 http 服務(wù)通過防火墻(永久)

yum install httpd 

firewall-cmd --add-service=http 

firewall-cmd --permanent --add-service=http

添加 Apache 服務(wù)到系統(tǒng)層使其隨系統(tǒng)自動(dòng)啟動(dòng)

systemctl start httpd.service

systemctl enable httpd.service


3.1.2 安裝本地源制作相關(guān)工具

下載 Ambari 2.2.2 , HDP 2.4.2 的安裝資源,本次安裝是在Centos 7 上,只列出centos7的資源,其他系統(tǒng)的請(qǐng)現(xiàn)在對(duì)用系統(tǒng)的資源,不同版本資源請(qǐng)上http://docs.hortonworks.com/index.html上查找

Ambari 2.2.2 下載資源

OS Format URL

CentOS 7 Base URL http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.2.2.0


CentOS 7 Repo File http://public-repo-1.hortonworks.com/ambari/centos6/2.x/updates/2.2.2.0/ambari.repo


CentOS 7 Tarball md5 asc http://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 下載資源

OS Repository Name Format URL

CentOS 7 HDP Base URL http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.4.2.0


CentOS 7 HDP Repo File http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.4.2.0/hdp.repo


CentOS 7 HDP Tarball md5 asc http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.4.2.0/HDP-2.4.2.0-centos7-rpm.tar.gz


CentOS 7 HDP-UTILS Base URL http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos7


CentOS 7 HDP-UTILS Repo File http://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網(wǎng)站根目錄,默認(rèn)是即/var/www/html/,

cd /var/www/html/

根據(jù)版本創(chuàng)建目錄:Ambari2.2.2.0-HDP2.4.2.0

mkdir Ambari2.2.2.0-HDP2.4.2.0

進(jìn)入/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

驗(yàn)證httd網(wǎng)站是否可用,可以使用瀏覽器直接訪問下面的地址:

HTTP://192.168.1.202/Ambari2.2.2.0-HDP2.4.2.0

3.3 配置ambari、HDP、HDP-UTILS的本地源

首先下載上面資源列表中的相應(yīng)repo文件,修改其中的URL為本地的地址,相關(guān)配置如下:


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.進(jìn)行安裝Ambari

4.1 安裝Ambari2.2.2

4.1.1安裝Ambari

yum install ambari-server


如果報(bào)錯(cuò),提示:

Error: Package: ambari-server-2.2.2.0-460.x86_64 (ambari-2.2.2.0)

Requires: postgresql-server >= 8.1

原因是postgresql沒有安裝或版本太低,將Postgresql相關(guān)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 

下面是配置執(zhí)行流程,按照提示操作  

1. 檢查SELinux是否關(guān)閉,輸入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. 提示是否自定義設(shè)置。輸入:y 

 Customize user account for ambari-server daemon [y/n] (n)? y 

3. ambari-server 賬號(hào)。直接回車 

Enter user account for ambari-server daemon (root): 

Adjusting ambari-server permissions and ownership...

4. 檢查防火墻,如果關(guān)閉則不用操作  

Checking firewall status... 

Redirecting to /bin/systemctl status  iptables.service 

5. 設(shè)置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,則需要設(shè)置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. 數(shù)據(jù)庫配置。選擇:y 

 Configuring database... Enter advanced database configuration [y/n] (n)? y 

8. 選擇數(shù)據(jù)庫類型。輸入:1  ,Ambari內(nèi)置PostgreSQL數(shù)據(jù)庫

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. 設(shè)置數(shù)據(jù)庫的具體配置信息,根據(jù)實(shí)際情況輸入,如果和括號(hào)內(nèi)相同,則可以直接回車。  

Hostname (localhost):  

Port ():  

Database name (ambari): 

Username (ambari):ambari

Enter Database Password (bigdata):ambari

4.1.3啟動(dòng)Amabri

執(zhí)行啟動(dòng)命令,啟動(dòng)Ambari服務(wù)

ambari-server start

成功啟動(dòng)后在瀏覽器輸入Ambari地址:

http://192.168.1.202:8080/

出現(xiàn)登錄界面,默認(rèn)管理員賬戶登錄, 賬戶:admin 密碼:admin

 

登錄成功后出現(xiàn)下面的界面,至此Ambari的安裝成功 

 

4.2 安裝安裝HDP 2.4.2 配置集群

點(diǎn)擊上面登錄成功頁面的Launch Install Wizard 按鈕進(jìn)行集群配置

4.2.1設(shè)置集群名稱 

 

4.2.2設(shè)置HDP 安裝源

選擇HDP2.4 ,并且設(shè)置Advanced Repository Options 的信息,本次使用本地源,所以修改對(duì)用系統(tǒng)的安裝源為本地源地址。

 

4.2.3設(shè)置集群機(jī)器 

 

4.2.4 Host 確認(rèn)

確認(rèn)前面配置集群中hosts列表 中的機(jī)器是否都可用,也可以移除相關(guān)機(jī)器,集群中機(jī)器Success后進(jìn)行下一步操作。


 

4.2.5 選擇要安裝的服務(wù)

 

4.2.6各個(gè)服務(wù)Master配置 

 

4.2.6 服務(wù)的Slaves 和 Clients節(jié)配置

 

4.2.7 服務(wù)的客制化配置 

 


其中Ambari Metrics中的Grafana Admin Password必須要在初始化時(shí)設(shè)置:密碼設(shè)置為:grafana


 

HIVE的METASTORE DATAABSE的DATABASE Password也必須設(shè)置,設(shè)置為:hive

4.2.8 顯示配置信息

 







 4.2.9開始安裝

安裝各個(gè)服務(wù),并且完成安裝后會(huì)啟動(dòng)相關(guān)服務(wù),安裝過程比較長,如果中途出現(xiàn)錯(cuò)誤,請(qǐng)根據(jù)具體提示或者log進(jìn)行操作。  

全部安裝成功界面如下 

 


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI