六、Ambari-server的安装与配置启动

企业级大数据平台Ambari搭建与管理

本节中我们将介绍Ambari-server的安装与配置启动

本节的操作只需要在Hadoop01节点上进行:

1、安装ambari-server

切换到hadoop用户:

[[email protected] ~]# su hadoop

六、Ambari-server的安装与配置启动

安装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!

六、Ambari-server的安装与配置启动
六、Ambari-server的安装与配置启动

安装成功!

2、配置ambari-server

检查SELinux是否关闭:

这里的状态是关闭的,继续进行下一步。
六、Ambari-server的安装与配置启动

使用指定的用户:

输入:no,
输入:hadoop

输入no,输入hadoop用户
六、Ambari-server的安装与配置启动

检查防火墙:

这里我们的防火墙是关闭的,进行下一步
六、Ambari-server的安装与配置启动

检查JDK

这里我们选择自己安装的JDK

选择:3
输入JDK的安装路径:/usr/local/jdk1.8

六、Ambari-server的安装与配置启动

GPL License

选择下载安装GPL License

输入:y

六、Ambari-server的安装与配置启动

数据库配置

这里我们选择内置的PostgreSQL数据库

输入:n

六、Ambari-server的安装与配置启动
###配置完成:
六、Ambari-server的安装与配置启动

[[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状态

六、Ambari-server的安装与配置启动
ambari-server的状态是正在运行。

使用web界面登录ambari-server

打开浏览器,输入以下网址来访问Ambari

http://192.168.10.101/8080/

六、Ambari-server的安装与配置启动

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