当前位置:   article > 正文

安装ambari_ambari安装

ambari安装

安装Mysql

  1. 下载并安装
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
  • 1
  • 2
  • 3
  1. 启动mysql并查看密码
Systemctl start mysqld
Grep “password” /var/log/mysqld.log
  • 1
  • 2
  1. 修改root密码
Alter user user() identified by ‘admin123’;
  • 1
  1. 修改my.cnf配置文件
# 在[mysqld]下添加
collation_server=utf8_general_ci
character_set_server=utf8
default-storage-engine=INNODB
# 在[client]下添加(如果没有[client],则创建)
default_character-set=utf8
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  1. 查看字符集
mysql> show variables like 'character_set_%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  1. 创建ambari数据库及用户及远程登录
mysql> create database ambari character set utf8;
Query OK, 1 row affected (5.00 sec)
mysql> CREATE USER 'ambari'@'%'IDENTIFIED BY 'admin123';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON ambari.* TO 'ambari'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  1. 创建hive数据库及用户及远程登录
mysql> create database hive character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'hive'@'%'IDENTIFIED BY 'admin123';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON hive.* TO 'hive'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  1. 创建oozie数据库及用户及远程登录
mysql> create database oozie character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'oozie'@'%'IDENTIFIED BY 'admin123';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON oozie.* TO 'oozie'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)	
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  1. 创建ranger数据库及用户及远程登录
mysql> create database ranger character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE USER 'rangeradmin'@'%'IDENTIFIED BY 'admin123';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON ranger.* TO 'rangeradmin'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

安装apache

  1. 安装apache
Yum -y install httpd
  • 1
  1. 启动
Systemctl start httpd
  • 1

配置本地yum源

  1. 配置ambari.repo
[root@localhost yum.repos.d]# cat ambari.repo 
# VERSION_NUMBER=2.7.3.0-139
[ambari-2.7.3.0]
# json.url = http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json
name=ambari Version - ambari-2.7.3.0
baseurl=http://172.16.10.119/ambari/ambari/centos7/2.7.3.0-139
gpgcheck=1
gpgkey=http://172.16.10.119/ambari/ambari/centos7/2.7.3.0-139/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  1. 配置HDP.repo
[root@localhost yum.repos.d]# cat HDP.repo 
# VERSION_NUMBER=3.1.0.0-78
[HDP-3.1.0.0]
name=HDP Version - HDP-3.1.0.0
baseurl=http://172.16.10.119/hdp/HDP/centos7
gpgcheck=1
gpgkey=http://172.16.10.119/hdp/HDP/centos7/3.1.0.0-78/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

[HDP-UTILS-1.1.0.22]
name=HDP-UTILS Version - HDP-UTILS-1.1.0.22
baseurl=http://172.16.10.119/hdp/HDP-UTILS-1.1.0.22
gpgcheck=1
gpgkey=http://172.16.10.119/hdp/HDP-UTILS-1.1.0.22/HDP-UTILS/centos7/1.1.0.22/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

[HDP-GPL-3.1.0.0]
name=HDP-UTILS Version - HDP-GPL-3.1.0.0
baseurl=http://172.16.10.119/hdp/HDP-GPL
gpgcheck=1
gpgkey=http://172.16.10.119/hdp/HDP-GPL/centos7/3.1.0.0-78/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  1. 创建源目录并解压安装包
Mkdir /var/www/html/ambari
Mkdir /var/www/html/hdp
tar -zxvf ambari-2.7.3.0-centos7.tar.gz -C /var/www/html/ambari/
tar -zxvf HDP-3.1.0.0-centos7-rpm.tar.gz -C /var/www/html/hdp/
tar -zxvf HDP-UTILS-1.1.0.22-centos7.tar.gz -C /var/www/html/hdp/HDP-UTILS-1.1.0.22/
tar -zxf HDP-GPL-3.1.0.0-centos7-gpl.tar.gz -C /var/www/html/hdp/
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  1. 生成本地源并创建源数据
createrepo /var/www/html/hdp/HDP/centos7/
createrepo /var/www/html/hdp/HDP-UTILS-1.1.0.22/
createrepo /var/www/html/hdp/HDP-GPL/
  • 1
  • 2
  • 3
  1. 分发repo文件
Scp ambari.repo HDP.repo root@172.16.10.106:/etc/yum.repo.d/
Scp ambari.repo HDP.repo root@172.16.10.107:/etc/yum.repo.d/
  • 1
  • 2

配置ssh互信(所有机器都需要执行)

  1. 生成密钥及免密登录
ssh-keygen -t rsa
ssh-copy-id -i root@172.16.10.105
ssh-copy-id -i root@172.16.10.106
ssh-copy-id -i root@172.16.10.107
  • 1
  • 2
  • 3
  • 4

配置hosts件及主机名(所有服务器都需要执行

  1. 配置host文件
Cat /etc/hosts
172.16.10.119		yum 	yum.hdp
172.16.10.105		nd-00	nd-00.hdp
172.16.10.106    nd-01   nd-01.hdp
172.16.10.107 nd-02   nd-02.hdp
  • 1
  • 2
  • 3
  • 4
  • 5
  1. 配置主机名
Hostnamectl set-hostname nd-00.hdp
  • 1

修改network文件(所有机器都需要执行)

cat /etc/sysconfig/network
# Created by anaconda
NETWORKING=yes
HOSTNAME=nd-00.hdp
  • 1
  • 2
  • 3
  • 4

配置JAVA环境

  1. 解压JDK及配置环境变量
tar -zxf jdk-8u171-linux-x64.tar.gz -C /data/java
	
tee -a /etc/profile.d/java.sh <<EOF
export JAVA_HOME=/data/java/jdk1.8.0_171
export JRE_HOME=/data/java/jdk1.8.0_171/jre
export PATH=$PATH:/data/java/jdk1.8.0_171/bin
export CLASSPATH=./:/data/java/jdk1.8.0_171/lib:/data/java/jdk1.8.0_171/jre/lib
EOF

Source /etc/profile.d/java.sh
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

安装ambari-server及初始化(只在master安装)

  1. 下载mysql驱动
mv mysql-connector-java-8.0.5.jar /usr/share/java/mysql-connector-java.jar
  • 1
  1. 安装ambari
yum -y install ambari-server
  • 1
  1. 初始化ambari
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):root		# 用户
Adjusting ambari-server permissions and ownership...
Checking firewall status...
Checking JDK...
[1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8
[2] Custom JDK
==============================================================================
Enter choice (1): 2		# 选择自定义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: /data/java/jdk1.8.0_171		# jdk安装路径
Validating JDK on Ambari Server...done.
Check JDK version for Ambari Server...
JDK version found: 8
Minimum JDK version is 8 for Ambari. Skipping to setup different JDK for Ambari Server.
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		# 选择安装的mysql
Hostname (localhost): nd-00		# 配置hostname
Port (3306): 		# 默认
Database name (ambari): 
Username (ambari): 
Enter Database Password (bigdata): 		# 密码不显示
Re-enter password: 
Configuring ambari database...
Should ambari use existing default jdbc /usr/share/java/mysql-connector-java.jar [y/n] (y)? y
Configuring remote database connection properties...
WARNING: Before starting Ambari Server, you must run the following DDL directly from the database shell to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql		# 此处需注意,启动ambari之前需要执行此句
Proceed with configuring remote database connection properties [y/n] (y)? y
Extracting system views...
ambari-admin-2.7.3.0.139.jar
....
Ambari repo file contains latest json url http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json, updating stacks repoinfos with it...
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.		# 安装成功

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  1. 根据提示导入sql文件
Mysql -uambari -p
Use ambari
Source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql;
  • 1
  • 2
  • 3
  1. 启动ambari-server
Ambari-server start
  • 1

启动成功截图

安装ambari-agent(需要在所有的服务器安装)

  1. 安装及启动
Yum -y install ambari-server 
Ambari-agent start	
  • 1
  • 2

访问Ambari web页面

  1. 默认端口8080,Username:admin;Password:admin;http://192.168.121.100:8080
    在这里插入图片描述
    在这里插入图片描述
  2. 开始安装集群,启用安装向导创建集群
    3.
  3. 配置集群名称
    4.
  4. 选择版本
    5.
  5. 配置节点、密钥
    6.
  6. 主机确认在这里插入图片描述
  7. 选择大数据组件
    4.
  8. 节点分配
    9.
  9. 分配从属和客户端
    在这里插入图片描述
  10. 定制服务
    在这里插入图片描述
    在这里插入图片描述
ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar
  • 1

在这里插入图片描述在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  1. 集群整体概况,点击部署
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
  2. 等待启动完毕,不用担心警告,后期可以调整,搭建完成,可以在展示页面进行查看集群状态。
    在这里插入图片描述
    在这里插入图片描述
  3. 可以查看监控界面,可以看到大数据组件中出现错误,单个组件点开处理,由于本次搭建集群使用虚拟机,性能不好,可以少选择一些组件。
    14.
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/712194
推荐阅读
相关标签
  

闽ICP备14008679号