centos7.5 安装ambari操作说明

概述

     Ambari 跟 Hadoop 等开源软件一样,也是 Apache Software Foundation 中的一个项目,并且是顶级项目。2018年11月为止最新的发布版本是 2.7.3。就 Ambari 的作用来说,就是创建、管理、监视 Hadoop 的集群,但是这里的 Hadoop 是广义,指的是 Hadoop 整个生态圈(例如 Hive,Hbase,Sqoop,Zookeeper 等),而并不仅是特指 Hadoop。用一句话来说,Ambari 就是为了让 Hadoop 以及相关的大数据软件更容易使用的一个工具。 

Ambari主要取得了以下成绩:

  • 通过一步一步的安装向导简化了集群供应。

  • 预先配置好关键的运维指标(metrics),可以直接查看Hadoop Core(HDFS和MapReduce)及相关项目(如HBase、Hive和HCatalog)是否健康。

  • 支持作业与任务执行的可视化与分析,能够更好地查看依赖和性能。

  • 通过一个完整的RESTful API把监控信息暴露出来,集成了现有的运维工具。

  • 用户界面非常直观,用户可以轻松有效地查看信息并控制集群。

一、环境准备

操作系统:centos7.5 x64

软件版本:ambari-2.6.1.5  python 2.7  mysql 5.6/mariadb 5.5  jdk1.8 mysql-connector-java

硬件要求:内存2G以上  双核

服务器IP:192.168.142.11

二、安装(以下操作默认已关闭防火墙、SElinux)

2.1 安装制作本地源工具
     yum install yum-utils createrepo
2.2 创建一个HTTP服务器
    yum install httpd -y
    systemctl enable httpd && systemctl start httpd
2.3 下载安装包

    wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.1.5/ambari-2.6.1.5-centos7.tar.gz

2.4 解压安装包

   tar -zxvf ambari-2.6.1.5-centos7.tar.gz -C /var/www/html

2.5 验证地址是否生效

   浏览器输入:http://192.168.142.11/ambari/

   正常的情况下,可以看到文件列表

    centos7.5 安装ambari操作说明_第1张图片

2.6 配置ambari本地yum源

     cp /var/www/html/ambari/centos7/2.6.1.5-3/ambari.repo /etc/yum.repos.d/

     编辑文件 vim /etc/yum.repos.d/ambari.repo

#VERSION_NUMBER=2.6.1.5-3
[ambari-2.6.1.5]
name=ambari Version - ambari-2.6.1.5
baseurl=http://192.168.142.11/ambari/centos7/2.6.1.5-3
gpgcheck=1
gpgkey=http://192.168.142.11/ambari/centos7/2.6.1.5-3/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

   然后执行命令

yum clean all
yum list update
yum makecache
yum repolist

2.7 以上设置完成之后,开始执行安装

   yum install ambari-server -y

2.8 设置mysql连接器

   ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar

2.9 创建ambari数据库

mysql -uroot -pRoot-123

create database ambari character set utf8 ;  
CREATE USER 'ambari'@'%'IDENTIFIED BY 'Ambari-123';
GRANT ALL PRIVILEGES ON *.* TO 'ambari'@'%';
FLUSH PRIVILEGES;

2.10 设置ambari-server

  ambari-server setup

ambari-server setup
Using python  /usr/bin/python2
Setup ambari-server
Checking SELinux...
SELinux status is 'enabled'
SELinux mode is 'permissive'
WARNING: SELinux is set to 'permissive' mode and temporarily disabled.
OK to continue [y/n] (y)? y
Customize user account for ambari-server daemon [y/n] (n)? y
Enter user account for ambari-server daemon (root):ambari
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: /opt/jdk1.8.0_151
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)? y
Configuring database...
==============================================================================
Choose one of the following options:
[1] - PostgreSQL (Embedded)
[2] - Oracle
[3] - MySQL / MariaDB
[4] - PostgreSQL
[5] - Microsoft SQL Server (Tech Preview)
[6] - SQL Anywhere
[7] - BDB
==============================================================================
Enter choice (1): 3
Hostname (localhost): 
Port (3306): 
Database name (ambari): 
Username (ambari): 
Enter Database Password (bigdata): 
Re-enter password: 
Configuring ambari database...
Configuring remote database connection properties...
WARNING: Before starting Ambari Server, you must run the following DDL against the database to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql
Proceed with configuring remote database connection properties [y/n] (y)? y
Extracting system views...
ambari-admin-2.6.1.5.3.jar
...........
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.

 如果使用root用户运行,该处则需要输入root,或者直接回车

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

2.11 初始化数据库脚本

mysql -uambari -pAmbari-123
use ambari;
source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql

2.12 启动ambari

    ambari-server start

    centos7.5 安装ambari操作说明_第2张图片

三、登录ambari

 浏览器输入:http://192.168.142.11:8080/

 默认帐号密码为:admin admin

 centos7.5 安装ambari操作说明_第3张图片

如需安装HDP等组件可参数以上的本地yum源安装方式将安装包放到httpd的目录下,在ambari界面执行安装即可!

centos7.5 安装ambari操作说明_第4张图片

centos7.5 安装ambari操作说明_第5张图片

:若出现mysql驱动问题,只需执行 yum  install mysql 即可

centos7.5 安装ambari操作说明_第6张图片

你可能感兴趣的:(BigData)