Ambari 2.6.0 HDP 2.6.3集群搭建
?
1.安裝環(huán)境說明
?
三臺(tái)機(jī)器安裝好CentOS-7-x86_64-Minimal-1708.iso
下載地址:https://www.centos.org/download/
最好在安裝時(shí)設(shè)置好IP和HOSTNAME
三臺(tái)機(jī)器的IP和HOSTNAME下載如下
主 192.168.31.11 SY-001.hadoop
從 192.168.31.12 SY-002.hadoop
從 192.168.31.13 SY-003.hadoop
每個(gè)節(jié)點(diǎn)設(shè)置host
[root@SY-001 ~]#?vi /etc/hosts
127.0.0.1? ?localhost localhost.localdomain localhost4 localhost4.localdomain4
::1? ? ? ? ?localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.31.11 SY-001 SY-001.hadoop
192.168.31.12 SY-002 SY-002.hadoop
192.168.31.13 SY-003 SY-003.hadoop
2.操作系統(tǒng)環(huán)境準(zhǔn)備
2.1 配置SSH免密碼登錄
主節(jié)點(diǎn)里root用戶登錄執(zhí)行如下步驟
[root@SY-001 ~]#?ssh-keygen
[root@SY-001 ~]#?cd ~/.ssh/
[root@SY-001 ~]#?cat id_rsa.pub >>authorized_keys
[root@SY-001 ~]#?chmod 600 ~/.ssh
[root@SY-001 ~]#?chmod 600 ~/.ssh/authorized_keys
先在從節(jié)點(diǎn)登錄root執(zhí)行命令
[root@SY-002 ~]#?mkdir ~/.ssh/
[root@SY-003 ~]#?mkdir ~/.ssh/
分發(fā)主節(jié)點(diǎn)里配置好的authorized_keys到各從節(jié)點(diǎn)
[root@SY-001 ~]#?scp /root/.ssh/authorized_keys root@192.168.31.12:/root/.ssh/authorized_keys
[root@SY-001 ~]#?scp /root/.ssh/authorized_keys root@192.168.31.13:/root/.ssh/authorized_keys
2.2 創(chuàng)建ambari系統(tǒng)用戶和用戶組
只在主節(jié)點(diǎn)操作
添加ambari安裝、運(yùn)行用戶和用戶組,也可以不創(chuàng)建新用戶,直接使用root,我是直接用的root
[root@SY-001 ~]#?adduser ambari
[root@SY-001 ~]#?passwd ambari
2.3 開啟NTP服務(wù)
所有節(jié)點(diǎn)都需要操作
[root@SY-001 ~]#?yum install ntp
[root@SY-001 ~]#?systemctl is-enabled ntpd
[root@SY-001 ~]#?systemctl enable ntpd
[root@SY-001 ~]#?systemctl start ntpd
2.4 檢查DNS和NSCD
所有節(jié)點(diǎn)都要設(shè)置
ambari在安裝時(shí)需要配置全域名,所以需要檢查DNS。為了減輕DNS的負(fù)擔(dān), 建議在節(jié)點(diǎn)里用 Name Service Caching Daemon (NSCD)
[root@SY-001 ~]#?vi /etc/hosts
192.168.131.11 SY-001 SY-001.hadoop
192.168.131.12 SY-002 SY-002.hadoop
192.168.131.13 SY-003 SY-003.hadoop
每臺(tái)節(jié)點(diǎn)里配置FQDN,如下以主節(jié)點(diǎn)為例
[root@SY-001 ~]#?vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=SY-001.hadoop
2.5 關(guān)閉防火墻
所有節(jié)點(diǎn)都要設(shè)置
[root@SY-001 ~]#?systemctl disable firewalld
[root@SY-001 ~]#?systemctl stop firewalld
2.6 關(guān)閉SELinux
所有節(jié)點(diǎn)都要設(shè)置
查看SELinux狀態(tài):
[root@SY-001 ~]# sestatus
SELinux status:? ? ? ? ? ? ? ? ?enabled
[root@SY-001 ~]# sestatus
SELinux status:? ? ? ? ? ? ? ? ?disabled
臨時(shí)關(guān)閉,不用重啟機(jī)器:
[root@SY-001 ~]#?setenforce 0
修改配置文件需要重啟機(jī)器:
[root@SY-001 ~]#?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ù)通過防火墻(永久)
[root@SY-001 ~]#?yum install httpd
[root@SY-001 ~]#?firewall-cmd --add-service=http
[root@SY-001 ~]#?firewall-cmd --permanent --add-service=http
添加 Apache 服務(wù)到系統(tǒng)層使其隨系統(tǒng)自動(dòng)啟動(dòng)
[root@SY-001 ~]#?systemctl start httpd.service
[root@SY-001 ~]#?systemctl enable httpd.service
3.1.2 安裝本地源制作相關(guān)工具
[root@SY-001 ~]#?yum install yum-utils createrepo
3.2 下載安裝資源
下載 Ambari 2.6.0 , HDP 2.6.3 的安裝資源,本次安裝是在CentOS 7 上,只列出CentOS 7的資源,其他系統(tǒng)的請(qǐng)現(xiàn)在對(duì)用系統(tǒng)的資源
Ambari 2.6.0 下載資源
| RedHat 7 CentOS 7 Oracle Linux 7 | Base URL | http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.0.0 |
| Repo File | http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.0.0/ambari.repo | |
| Tarball | http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.0.0/ambari-2.6.0.0-centos7.tar.gz |
HDP 2.6.3 下載資源
| RedHat 7 CentOS 7 Oracle Linux 7 | HDP-2.6.3.0 | HDP | Version Definition File (VDF) | http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.3.0/HDP-2.6.3.0-235.xml |
| Base URL | http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.3.0 | |||
| Repo File | http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.3.0/hdp.repo | |||
| Tarball | http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.3.0/HDP-2.6.3.0-centos7-rpm.tar.gz | |||
| HDP-UTILS | Base URL | http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.21/repos/centos7 | ||
| Tarball | http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.21/repos/centos7/HDP-UTILS-1.1.0.21-centos7.tar.gz |
下載上面列表的中的壓縮包,?
需要下載的壓縮包如下:
Ambari2.6.0
http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.0.0/ambari-2.6.0.0-centos7.tar.gz
HDP2.6.3
http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.3.0/HDP-2.6.3.0-centos7-rpm.tar.gz
HDP-UTILS1.1.0.21
http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.21/repos/centos7/HDP-UTILS-1.1.0.21-centos7.tar.gz
在httpd網(wǎng)站根目錄,默認(rèn)是即/var/www/html/,創(chuàng)建目錄ambari,?
并且將下載的壓縮包解壓到/var/www/html/ambari目錄
HDP-UTILS需要先建立一個(gè)HDP-UTILS文件夾并將HDP-UTILS-1.1.0.21-centos7.tar.gz放到HDP-UTILS目錄下再解壓
[root@SY-001 ~]#?cd /var/www/html/
[root@SY-001 html]#?mkdir ambari
[root@SY-001 html]#?cd /var/www/html/ambari/
[root@SY-001 ambari]#?wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.0.0/ambari-2.6.0.0-centos7.tar.gz
[root@SY-001 ambari]#?wget http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.3.0/HDP-2.6.3.0-centos7-rpm.tar.gz
[root@SY-001 ambari]#?wget http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.21/repos/centos7/HDP-UTILS-1.1.0.21-centos7.tar.gz
[root@SY-001 ambari]#?tar -zxvf ambari-2.6.0.0-centos7.tar.gz
[root@SY-001 ambari]#?tar -zxvf HDP-2.6.3.0-centos7-rpm.tar.gz
[root@SY-001 ambari]#?mkdir HDP-UTILS
[root@SY-001 ambari]#?mv HDP-UTILS-1.1.0.21-centos7.tar.gz /var/www/html/ambari/HDP-UTILS/
[root@SY-001 ambari]#?tar -zxvf HDP-UTILS-1.1.0.21-centos7.tar.gz
驗(yàn)證httpd網(wǎng)站是否可用,用瀏覽器直接訪問下面的地址,如果能看到目錄列表就表示成功:
http://192.168.31.1/ambari/
3.3 配置ambari、HDP、HDP-UTILS的本地源
首先下載上面資源列表中的相應(yīng)repo文件,修改其中的URL為本地的地址,相關(guān)配置如下:
ambari.repo
[root@SY-001 yum.repos.d]# vi ambari.repo?
#VERSION_NUMBER=2.6.0.0-267
[ambari-2.6.0.0]
name=ambari Version - ambari-2.6.0.0
baseurl=http://192.168.31.11/ambari/ambari/centos7/2.6.0.0-267
gpgcheck=1
gpgkey=http://192.168.31.11/ambari/ambari/centos7/2.6.0.0-267/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
hdp.repo
[root@SY-001 yum.repos.d]# vi hdp.repo?
#VERSION_NUMBER=2.6.3.0-235
[HDP-2.6.3.0]
name=HDP Version - HDP-2.6.3.0
baseurl=http://192.168.31.11/ambari/HDP/centos7/2.6.3.0-235
gpgcheck=1
gpgkey=http://192.168.31.11/ambari/HDP/centos7/2.6.3.0-235/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
[HDP-UTILS-1.1.0.21]
name=HDP Utils Version - HDP-UTILS-1.1.0.21
baseurl=http://192.168.31.11/ambari/HDP-UTILS
gpgcheck=1
gpgkey=http://192.168.31.11/ambari/HDP-UTILS/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
將上面的修改過的源放到/etc/yum.repos.d/下面
[root@SY-001 yum.repos.d]# yum clean all
[root@SY-001 yum.repos.d]# yum list update
[root@SY-001 yum.repos.d]# yum makecache
[root@SY-001 yum.repos.d]# yum repolist
3.4 安裝Mysql數(shù)據(jù)庫
Ambari安裝會(huì)將安裝等信息寫入數(shù)據(jù)庫,建議使用MariaDB數(shù)據(jù)庫,也可以不安裝而使用默認(rèn)數(shù)據(jù)庫PostgreSQL
[root@SY-001 ~]# yum install mariadb-server
[root@SY-001 ~]# systemctl start mariadb
[root@SY-001 ~]# systemctl enable mariadb
#數(shù)據(jù)庫初始化設(shè)置
[root@SY-001 ~]# mysql_secure_installation
#首先是設(shè)置密碼,會(huì)提示先輸入密碼
Enter current password for root (enter for none):<–初次運(yùn)行直接回車
#設(shè)置密碼
Set root password? [Y/n] <– 是否設(shè)置root用戶密碼,輸入y并回車或直接回車
New password: <– 設(shè)置root用戶的密碼
Re-enter new password: <– 再輸入一次你設(shè)置的密碼
#其他配置
Remove anonymous users? [Y/n] <– 是否刪除匿名用戶,回車
Disallow root login remotely? [Y/n] <–是否禁止root遠(yuǎn)程登錄,回車,
Remove test database and access to it? [Y/n] <– 是否刪除test數(shù)據(jù)庫,回車
Reload privilege tables now? [Y/n] <– 是否重新加載權(quán)限表,回車
#初始化MariaDB完成,接下來測(cè)試登錄,輸入密碼能正常登陸就完成了
[root@SY-001 ~]# mysql -uroot -p
安裝完成后創(chuàng)建ambari數(shù)據(jù)庫及用戶,登錄數(shù)據(jù)庫root用戶執(zhí)行下面語句:
[root@SY-001 ~]# mysql -uroot -p
createdatabase ambari characterset utf8 ;?
CREATEUSER'ambari'@'%'IDENTIFIED BY'Ambari-123';
GRANTALLPRIVILEGESON *.* TO'ambari'@'%';
FLUSH PRIVILEGES;
如果要安裝Hive,再創(chuàng)建Hive數(shù)據(jù)庫和用戶再執(zhí)行下面的語句:
createdatabase hive characterset utf8 ;?
CREATEUSER'hive'@'%'IDENTIFIED BY'Hive-123';
GRANTALLPRIVILEGESON *.* TO'hive'@'%';
FLUSH PRIVILEGES;
如果要安裝Oozie,再創(chuàng)建Oozie數(shù)據(jù)庫和用戶再執(zhí)行下面的語句:
createdatabase oozie characterset utf8 ;?
CREATEUSER'oozie'@'%'IDENTIFIED BY'Oozie-123';
GRANTALLPRIVILEGESON *.* TO'oozie'@'%';
FLUSH PRIVILEGES;
安裝mysql jdbc 驅(qū)動(dòng)
[root@SY-001 ~]# yum install mysql-connector-java
3.5 安裝JDK
Java SE Development Kit 8u152下載地址:http://www.oracle.com/technetwork/cn/java/javase/downloads/jdk8-downloads-2133151-zhs.html
下載解壓版jdk-8u152-linux-x64.tar.gz,再執(zhí)行下面命令:
[root@SY-001 ~]# tar -zxvf jdk-8u152-linux-x64.tar.gz -C /opt/java/
[root@SY-001 ~]# vi /etc/profile
export JAVA_HOME=/opt/java/jdk1.8.0_152
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
source /etc/profile
4.進(jìn)行安裝Ambari
4.1 安裝Ambari2.6.0
4.1.1安裝Ambari
[root@SY-001 ~]# yum install ambari-server
4.1.2配置Ambari
[root@SY-001 ~]# ambari-server setup
下面是配置執(zhí)行流程,按照提示操作
1.檢查SELinux是否關(guān)閉,如果關(guān)閉不用操作
Using python? /usr/bin/python
Setup ambari-server
Checking SELinux...
SELinux status is'disabled'
2.提示是否自定義設(shè)置。輸入:y
Customize user account for ambari-server daemon [y/n] (n)? y
3.ambari-server 賬號(hào)。輸入:ambari
Enter user account for ambari-server daemon (root):ambari
Adjusting ambari-server permissions and ownership...
4.檢查防火墻,如果關(guān)閉則不用操作
Checking firewall status...
Redirecting to /bin/systemctl status? iptables.service
5.設(shè)置JDK。輸入:3
Checking JDK...
Do you want to change Oracle JDK [y/n] (n)? y
[] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8
[] Oracle JDK 1.7 + Java Cryptography Extension (JCE) Policy Files 7
[] Custom JDK
==============================================================================
Enter choice (1): 3
6.如果上面選擇3自定義JDK,則需要設(shè)置JAVA_HOME。輸入:/opt/java/jdk1.8.0_152
WARNING: JDK must be installed onall hosts and JAVA_HOME must be valid onall 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 onall hosts.
Path to JAVA_HOME: /opt/java/jdk1.8.0_152
Validating JDK on Ambari Server...done.
Completing setup...
7.數(shù)據(jù)庫配置。選擇:y
Configuringdatabase...
Enteradvanceddatabaseconfiguration[y/n] (n)? y
8.選擇數(shù)據(jù)庫類型。輸入:3
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 (3): 3
9.設(shè)置數(shù)據(jù)庫的具體配置信息,根據(jù)實(shí)際情況輸入,如果和括號(hào)內(nèi)相同,則可以直接回車。
Hostname (localhost):
Port (3306):
Database name (ambari):
Username (ambari):
Enter Database Password (Ambari-123):
10.提示必須安裝MySQL JDBC,回車結(jié)束ambari配置
WARNING: Before starting Ambari Server, you must copy the MySQL JDBC driver JAR file to /usr/share/java.
Press <enter> to continue.
11.將Ambari數(shù)據(jù)庫腳本導(dǎo)入到數(shù)據(jù)庫
如果使用自己定義的數(shù)據(jù)庫,必須在啟動(dòng)Ambari服務(wù)之前導(dǎo)入Ambari的sql腳本
#用Ambari用戶(上面設(shè)置的用戶)登錄mysql
mysql -u ambari -p
use ambari;
source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
4.1.3啟動(dòng)Amabri
執(zhí)行啟動(dòng)命令,啟動(dòng)Ambari服務(wù)
[root@SY-001 ~]# ambari-server start
成功啟動(dòng)后在瀏覽器輸入Ambari地址:
http://192.168.31.1:8080/
出現(xiàn)登錄界面,默認(rèn)管理員賬戶登錄,賬戶:admin 密碼:admin
以下圖片用的別人的圖片,版本較低,僅供參考
?
登錄成功后出現(xiàn)下面的界面,至此Ambari的安裝成功?
?
4.2 安裝安裝HDP 2.6.3 配置集群
點(diǎn)擊上面登錄成功頁面的Launch Install Wizard 按鈕進(jìn)行集群配置
4.2.1設(shè)置集群名稱?
?
4.2.2設(shè)置HDP 安裝源
選擇HDP2.6 ,并且設(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ù)的客制化配置?
?
4.2.8 顯示配置信息?
?
4.2.9開始安裝
安裝各個(gè)服務(wù),并且完成安裝后會(huì)啟動(dòng)相關(guān)服務(wù),安裝過程比較長(zhǎng),如果中途出現(xiàn)錯(cuò)誤,請(qǐng)根據(jù)具體提示或者log進(jìn)行操作。?
?
?
安裝過程可以隨時(shí)查看每個(gè)節(jié)點(diǎn)的安裝進(jìn)度及日志?
?
全部安裝成功界面如下?
?
?
4.2.10安裝完成?
?
?
5、Hadooop開啟高可用(現(xiàn)在安裝好Hadoop是不支高可用的,下面準(zhǔn)備開啟Hadoop高可用)
1、開啟高可用開關(guān)
?
2、設(shè)置高可用名稱(如果hbase是啟動(dòng)的話請(qǐng)關(guān)閉在開啟HA高可用)
?
3、選擇服務(wù)安裝在那臺(tái)主機(jī)上
?
4、按照提示操作,最后顯示如下表示HA安裝成功
?
5、Hbase高可用會(huì)顯示如下圖
?
參考資料:
http://blog.csdn.net/mawenwu1983/article/details/78983275
?
?
參考資料:
http://blog.csdn.net/mawenwu1983/article/details/78983275
轉(zhuǎn)載于:https://www.cnblogs.com/lingluo2017/p/8711073.html
總結(jié)
以上是生活随笔為你收集整理的Ambari 2.6.0 HDP 2.6.3集群搭建的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Selenium WebDriver-
- 下一篇: Flume整合Kafka采集滚动的日志