1. 程式人生 > >六、Ambari-server的安裝與配置啟動

六、Ambari-server的安裝與配置啟動

企業級大資料平臺Ambari搭建與管理

本節中我們將介紹Ambari-server的安裝與配置啟動

本節的操作只需要在Hadoop01節點上進行:

1、安裝ambari-server

切換到hadoop使用者:

[[email protected] ~]# su hadoop

在這裡插入圖片描述

安裝ambari-server

[[email protected] root]$ sudo yum install -y ambari-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
HDP-2.6.5.0                                                                                                                          | 2.9 kB  00:00:00     
HDP-UTILS-1.1.0.22                                                                                                                   | 2.9 kB  00:00:00     
ambari-2.6.2.2                                                                                                                       | 2.9 kB  00:00:00     
base                                                                                                                                 | 3.6 kB  00:00:00     
extras                                                                                                                               | 3.4 kB  00:00:00     
updates                                                                                                                              | 3.4 kB  00:00:00     
Resolving Dependencies
--> Running transaction check
---> Package ambari-server.x86_64 0:2.6.2.2-1 will be installed
--> Processing Dependency: postgresql-server >= 8.1 for package: ambari-server-2.6.2.2-1.x86_64
--> Running transaction check
---> Package postgresql-server.x86_64 0:9.2.24-1.el7_5 will be installed
--> Processing Dependency: postgresql-libs(x86-64) = 9.2.24-1.el7_5 for package: postgresql-server-9.2.24-1.el7_5.x86_64
--> Processing Dependency: postgresql(x86-64) = 9.2.24-1.el7_5 for package: postgresql-server-9.2.24-1.el7_5.x86_64
--> Processing Dependency: libpq.so.5()(64bit) for package: postgresql-server-9.2.24-1.el7_5.x86_64
--> Running transaction check
---> Package postgresql.x86_64 0:9.2.24-1.el7_5 will be installed
---> Package postgresql-libs.x86_64 0:9.2.24-1.el7_5 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================
 Package                                  Arch                          Version                                 Repository                             Size
============================================================================================================================================================
Installing:
 ambari-server                            x86_64                        2.6.2.2-1                               ambari-2.6.2.2                        718 M
Installing for dependencies:
 postgresql                               x86_64                        9.2.24-1.el7_5                          updates                               3.0 M
 postgresql-libs                          x86_64                        9.2.24-1.el7_5                          updates                               234 k
 postgresql-server                        x86_64                        9.2.24-1.el7_5                          updates                               3.8 M

Transaction Summary
============================================================================================================================================================
Install  1 Package (+3 Dependent packages)

Total download size: 725 M
Installed size: 815 M
Downloading packages:
(1/4): postgresql-libs-9.2.24-1.el7_5.x86_64.rpm                                                                                     | 234 kB  00:00:00     
(2/4): postgresql-9.2.24-1.el7_5.x86_64.rpm                                                                                          | 3.0 MB  00:00:00     
(3/4): postgresql-server-9.2.24-1.el7_5.x86_64.rpm                                                                                   | 3.8 MB  00:00:00     
warning: /var/cache/yum/x86_64/7/ambari-2.6.2.2/packages/ambari-server-2.6.2.2-1.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 07513cad: NOKEY:00:00 ETA 
Public key for ambari-server-2.6.2.2-1.x86_64.rpm is not installed
(4/4): ambari-server-2.6.2.2-1.x86_64.rpm                                                                                            | 718 MB  00:00:16     
------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                        45 MB/s | 725 MB  00:00:16     
Retrieving key from http://192.168.10.101/ambari/ambari/centos7/2.6.2.2-1/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
Importing GPG key 0x07513CAD:
 Userid     : "Jenkins (HDP Builds) <
[email protected]
>" Fingerprint: df52 ed4f 7a3a 5882 c099 4c66 b973 3a7a 0751 3cad From : http://192.168.10.101/ambari/ambari/centos7/2.6.2.2-1/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : postgresql-libs-9.2.24-1.el7_5.x86_64 1/4 Installing : postgresql-9.2.24-1.el7_5.x86_64 2/4 Installing : postgresql-server-9.2.24-1.el7_5.x86_64 3/4 Installing : ambari-server-2.6.2.2-1.x86_64 4/4 Verifying : postgresql-server-9.2.24-1.el7_5.x86_64 1/4 Verifying : postgresql-libs-9.2.24-1.el7_5.x86_64 2/4 Verifying : postgresql-9.2.24-1.el7_5.x86_64 3/4 Verifying : ambari-server-2.6.2.2-1.x86_64 4/4 Installed: ambari-server.x86_64 0:2.6.2.2-1 Dependency Installed: postgresql.x86_64 0:9.2.24-1.el7_5 postgresql-libs.x86_64 0:9.2.24-1.el7_5 postgresql-server.x86_64 0:9.2.24-1.el7_5 Complete!

在這裡插入圖片描述 在這裡插入圖片描述

安裝成功!

2、配置ambari-server

檢查SELinux是否關閉:

這裡的狀態是關閉的,繼續進行下一步。 在這裡插入圖片描述

使用指定的使用者:

輸入:no,
輸入:hadoop

輸入no,輸入hadoop使用者 在這裡插入圖片描述

檢查防火牆:

這裡我們的防火牆是關閉的,進行下一步 在這裡插入圖片描述

檢查JDK

這裡我們選擇自己安裝的JDK

選擇:3
輸入JDK的安裝路徑:/usr/local/jdk1.8

在這裡插入圖片描述

GPL License

選擇下載安裝GPL License

輸入:y

在這裡插入圖片描述

資料庫配置

這裡我們選擇內建的PostgreSQL資料庫

輸入:n

在這裡插入圖片描述 ###配置完成: 在這裡插入圖片描述

[[email protected] root]$ sudo service ambari-server setup
Using python  /usr/bin/python
Setup ambari-server
Checking SELinux...
SELinux status is 'disabled'
Customize user account for ambari-server daemon [y/n] (n)? y
Enter user account for ambari-server daemon (root):hadop^C
Aborting ... Keyboard Interrupt.
[
[email protected]
root]$ sudo service ambari-server setup Using python /usr/bin/python Setup ambari-server Checking SELinux... SELinux status is 'disabled' Customize user account for ambari-server daemon [y/n] (n)? y Enter user account for ambari-server daemon (root):hadoop Adjusting ambari-server permissions and ownership... Checking firewall status... 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 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/jdk1.8 Validating JDK on Ambari Server...done. Checking GPL software agreement... GPL License for LZO: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html Enable Ambari Server to download and install GPL Licensed LZO packages [y/n] (n)? y Completing setup... Configuring database... Enter advanced database configuration [y/n] (n)? n Configuring database... Default properties detected. Using built-in database. Configuring ambari database... Checking PostgreSQL... Running initdb: This may take up to a minute. Initializing database ... OK About to start PostgreSQL Configuring local database... Configuring PostgreSQL... Restarting PostgreSQL Creating schema and user... done. Creating tables... done. Extracting system views... ambari-admin-2.6.2.2.1.jar ........... Adjusting ambari-server permissions and ownership... Ambari Server 'setup' completed successfully.

3、啟動ambari-server服務

配置完成,我們啟動ambari-server服務

啟動ambari-server服務

[[email protected] root]$ sudo service ambari-server start
Using python  /usr/bin/python
Starting ambari-server
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Ambari database consistency check started...
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start.......................................
Server started listening on 8080

DB configs consistency check: no errors and warnings were found.
Ambari Server 'start' completed successfully.

在這裡插入圖片描述 啟動成功

檢查ambari-server狀態

在這裡插入圖片描述 ambari-server的狀態是正在執行。

使用web介面登入ambari-server

開啟瀏覽器,輸入以下網址來訪問Ambari

http://192.168.10.101/8080/

在這裡插入圖片描述

至此ambari-server就安裝配置完成