文章目录

  • 1. 环境及软件准备
  • 2. 准备工作
    • 2.1 关闭防火墙
    • 2.2 配置域名映射
    • 2.3 配置免密
    • 2.4 时间同步
      • 2.4.1 时间服务器配置(root用户)
      • 2.4.2 其他服务器配置(root用户)
    • 2.5 安装JDK(所有节点)
    • 2.6 安装MySQL
    • 2.7 关闭SELinux
  • 3. 安装ambari
    • 3.1 配置ambari和hdp的yum源
      • 3.1.1 安装http
      • 3.1.2 开始配置ambari和hdp源
    • 3.2 配置和安装ambari-server
      • 3.2.1 安装ambari-server
      • 3.2.2 配置数据库
      • 3.2.3 将jdbc驱动包放到指定目录
      • 3.2.4 配置ambari-server
      • 3.2.5 启动ambari
    • 3.3 安装、配置ambari-agent节点
      • 3.3.1 安装ambari-agent(所有节点)
      • 3.3.2 配置(所有作为ambari-agent的节点都进行修改)
      • 3.3.3 启动ambari-agent
  • 4. 部署HPD
    • 4.1 登录ambari,默认用户名和密码都是`admin`
    • 4.2 集群配置

1. 环境及软件准备

Ambari-2.7.4和HDP-3.1.4下载提取码:3rwq
环境:CentOS7(我这里使用的是CentOS7.9版本)、三台虚拟机,单节点内存13GB、存储80GB

软件:mysql5.7+、jdk8、ambari-2.7.4.0-centos7.tar.gz、HDP-3.1.4.0-centos7-rpm.tar.gz、HDP-UTILS-1.1.0.22-centos7.tar.gz

2. 准备工作

2.1 关闭防火墙

systemctl status firewalld # 通过此命令查看防火墙状态
systemctl stop firewalld # 关闭防火墙
systemctl disable firewalld # 关闭防火墙开机自启

2.2 配置域名映射

确定好三台服务器的名称为hdp1、hdp2、hdp3,通过etc下的hosts文件配置域名映射

vi /etc/hosts #通过修改此文件来配置域名映射,文件内容如下127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.80.xxx hdp1 #域名映射
192.168.80.xxx hdp2 #域名映射
192.168.80.xxx hdp3 #域名映射

三台虚拟的域名映射要相同,配置完一台虚拟机的域名映射后,可通过scp命令将hosts文件发送到其他虚拟机

scp /etc/hosts hdp2:/etc/
scp /etc/hosts hdp3:/etc/

2.3 配置免密

三台虚拟机之间要进行免密配置

  1. 生成本机公钥

    ssh-keygen -t rsa #一直按Enter即可,直到生成公钥,如下所示[root@hdp1 ~]# ssh-keygen -t rsa
    Generating public/private rsa key pair.
    Enter file in which to save the key (/root/.ssh/id_rsa):
    Created directory '/root/.ssh'.
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /root/.ssh/id_rsa.
    Your public key has been saved in /root/.ssh/id_rsa.pub.
    The key fingerprint is:
    SHA256:ACrASg2gjSQ5bVXfCwR6HHeAW2KLmGlTgUqU+qFCo0c root@hdp2
    The key's randomart image is:
    +---[RSA 2048]----+
    |B*+o+o+o+..      |
    |BB+o.++=.o       |
    |O+o=.o+=o .      |
    |++E ..o. . .     |
    |o=.o    S .      |
    |+ o              |
    |..               |
    |                 |
    |                 |
    +----[SHA256]-----+
    
  2. 将本公钥发送给其他虚拟机

    # 公钥也要发给自己
    ssh-copy-id -i hdp1
    ssh-copy-id -i hdp2
    ssh-copy-id -i hdp3# 执行过程如下所示
    [root@hdp1 ~]# ssh-copy-id hdp1
    /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
    The authenticity of host 'hdp1 (192.168.80.xxx)' can't be established.
    ECDSA key fingerprint is SHA256:MHGsmoui6MpLb2qKf6QtKhP2KUIfiyFfzWEVpt8RVqE.
    ECDSA key fingerprint is MD5:30:aa:42:5a:2c:dc:67:21:65:aa:6d:xx:xx:xx:xx:xx.
    Are you sure you want to continue connecting (yes/no)? yes
    /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
    /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
    root@hdp1's password:Number of key(s) added: 1Now try logging into the machine, with:   "ssh 'hdp1'"
    and check to make sure that only the key(s) you wanted were added.
    
  3. 其他虚拟机执行相同步骤\

2.4 时间同步

选一台服务器作时间服务器,这里以hdp1作为时间服务器,其他服务器以时间服务器时间为准

2.4.1 时间服务器配置(root用户)

  1. 安装ntp服务

    yum install -y ntp
    
  2. 修改ntp配置文件

    修改/etc/ntp.conf文件

    vi /etc/ntp.conf
    

    2.1 授权192.168.1.0-192.168.1.255网段上的所有机器可以从这台机器上查询和同步时间

    修改
    #restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
    为
    restrict 192.168.80.0 mask 255.255.255.0 nomodify notrap #我这里使用的网段为80,具体网段根据服务器的ip而定
    

    2.2 集群在局域网和非局域网时间配置

    集群在局域网中,不使用其他互联网上的时间

    修改
    server 0.centos.pool.ntp.org iburst
    server 1.centos.pool.ntp.org iburst
    server 2.centos.pool.ntp.org iburst
    server 3.centos.pool.ntp.org iburst
    为
    #server 0.centos.pool.ntp.org iburst
    #server 1.centos.pool.ntp.org iburst
    #server 2.centos.pool.ntp.org iburst
    #server 3.centos.pool.ntp.org iburst
    

    集群使用互联网时间,这里使用阿里云时间服务器的时间

    # 将原来的注释掉
    #server 0.centos.pool.ntp.org iburst
    #server 1.centos.pool.ntp.org iburst
    #server 2.centos.pool.ntp.org iburst
    #server 3.centos.pool.ntp.org iburst
    # 添加如下
    server ntp1.aliyun.com iburst
    server ntp2.aliyun.com iburst
    server ntp3.aliyun.com iburst
    server ntp4.aliyun.com iburst
    server ntp5.aliyun.com iburst
    server ntp6.aliyun.com iburst
    server ntp7.aliyun.com iburst
    

    2.3 当该节点丢失网络连接,依然可以采用本地时间作为时间服务器为集群中的其他节点提供时间同步

    server 127.127.1.0
    fudge 127.127.1.0 stratum 10
    
  3. 启动ntp服务并设置开机自启

    systemctl start ntpd # 启动ntpd服务
    systemctl enable ntpd # 配置ntpd服务开机自启
    

2.4.2 其他服务器配置(root用户)

  1. 非时间服务器都安装ntpdate服务

    yum install -y ntpdate
    
  2. 同步时间

    ntpdate hdp1
    
  3. 定时同步时间

    通过crontab编写定时任务

    crontab -e# 添加如下内容
    29,59 * * * * /usr/sbin/ntpdate hdp1 # 每小时的第29分和59分同步一次时间
    

    到达时间点后通过date命令查看时间是否已经同步,当然配置间隔时间更短的任务,这样可以更快的看到效果。

2.5 安装JDK(所有节点)

将已经准备好的jdk上传至服务器,然后解压

tar -zxf jdk-8u231-linux-x64.tar.gz -C /opt/jdk8

解压后配置jdk的环境变量

vi /etc/profile# 添加如下内容,具体的jdk路径根据自己的实际路径填
export JAVA_HOME=/opt/apps/jdk1.8
export PATH=$PATH:$JAVA_HOME/bin

2.6 安装MySQL

数据库使用mysql作为元数据存储的数据库,详细安装步骤请见Mysql5.7.34安装

2.7 关闭SELinux

安装ambari-server的时候是需要关闭SELinux的,我们这里先提前将其关闭

# 临时性关闭(立即生效,但是重启服务器后失效)
setenforce 0 #设置selinux为permissive模式(即关闭)
setenforce 1 #设置selinux为enforcing模式(即开启)# 永久性关闭(这样需要重启服务器后生效)
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

3. 安装ambari

3.1 配置ambari和hdp的yum源

3.1.1 安装http

这里以hdp1作为ambari的yum源存储位置

# 安装httpd
yum install -y httpd# 启动http
systemctl start httpd# 将httpd加入到开机自启
systemctl enable httpd

3.1.2 开始配置ambari和hdp源

  1. 上传安装包并解压

    ambari-2.7.4.0-centos7.tar.gzHDP-3.1.4.0-centos7-rpm.tar.gzHDP-UTILS-1.1.0.22-centos7.tar.gz上传至hdp1服务器后解压

    # 先在/var/www/html目录下创建ambari、hdp、hdp-utils文件夹
    mkdir /var/www/html/ambari
    mkdir /var/www/html/hdp
    mkdir /var/www/html/hdp-utilstar -zxf /opt/ambari-2.7.4.0-centos7.tar.gz -C /var/www/html/ambari # 这里的-C是指定解压目录
    tar -zxf /opt/HDP-3.1.4.0-centos7-rpm.tar.gz -C /var/www/html/hdp
    tar -zxf /opt/HDP-UTILS-1.1.0.22-centos7.tar.gz -C /var/www/html/hdp-utils/
    
  2. 配置yum源

    因为通过yum源的在线安装速度太慢,所以我们要将已经下载好的离线安装包配置到yum源里

    # 配置ambari源
    vi /etc/yum.repos.d/ambari.repo#内容如下
    [ambari]
    name=ambari
    baseurl=http://192.168.80.xxx/ambari/ambari/centos7/2.7.4.0-118
    gpgcheck=0# 配置hdp和hdp-utils源
    vi /etc/yum.repos.d/hdp.repo# 内容如下
    [HDP]
    name=HDP
    baseurl=http://192.168.80.xxx/hdp/HDP/centos7/3.1.4.0-315
    gpgcheck=0
    [HDP-UTILS]
    name=HDP_UTILS
    baseurl=http://192.168.80.xxx/hdp-utils/HDP-UTILS/centos7/1.1.0.22/
    gpgcheck=0# yum创建缓存
    yum clean all
    yum makecache# 通过yum repolist命令验证即可
    yum repolist
    

    配置好yum源后将ambari.repohdp.repo文件发送到其他节点的/etc/yum.repos.d/目录下

3.2 配置和安装ambari-server

3.2.1 安装ambari-server

yum install -y ambari-server

3.2.2 配置数据库

# 登录已经安装好的mysql
mysql -uroot -ppasswordmysql>  CREATE USER 'ambari'@'%' IDENTIFIED BY 'password'; -- 创建ambari用户
Query OK, 0 rows affected (0.00 sec)mysql> create database ambari;
Query OK, 1 row affected (0.00 sec) -- 创建ambari数据库mysql> grant all on ambari.* to ambari@'%' identified by 'password';
Query OK, 0 rows affected, 1 warning (0.00 sec) -- 授权mysql> grant all on ambari.* to ambari@localhost identified by 'password';
Query OK, 0 rows affected, 1 warning (0.00 sec) -- 授权mysql> use ambari; -- 使用已经创建好的ambari数据库
Database changedmysql> source /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql -- 使用ambari-server提供的sql脚本创建相关表

3.2.3 将jdbc驱动包放到指定目录

# 创建目录
mkdir -p /usr/share/java# 将mysql的jdbc驱动放到此目录下
mv /root/mysql-connector-java-5.1.44.jar /usr/share/java/

3.2.4 配置ambari-server

# 执行ambari-server setup,如下[root@hdp1 ~]# 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):
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
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/apps/jdk1.8
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)?
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): hdp1
Port (3306):
Database name (ambari):
Username (ambari):
Enter Database Password (bigdata):
Re-enter password:
Configuring ambari database...
Enter full path to custom jdbc driver: /usr/share/java/mysql-connector-java-5.1.44.jar
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
Proceed with configuring remote database connection properties [y/n] (y)?
Extracting system views...
ambari-admin-2.7.4.0.118.jar
....
Ambari repo file doesn't contain latest json url, skipping repoinfos modification
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.

3.2.5 启动ambari

ambari-server start

启动后可通过http://:ip:8080进行访问

3.3 安装、配置ambari-agent节点

3.3.1 安装ambari-agent(所有节点)

yum install -y ambari-agent

3.3.2 配置(所有作为ambari-agent的节点都进行修改)

vi /etc/ambari-agent/conf/ambari-agent.ini# 将hostname=localhost修改为hdp1
[server]
hostname=hdp1

3.3.3 启动ambari-agent

ambari-agent start

4. 部署HPD

4.1 登录ambari,默认用户名和密码都是admin

4.2 集群配置

  1. 点击ClusterInformation --> LAUNCH INSTALL WIZARD

  2. 输入集群名称–>NEXT

  3. 选择HDP的版本,这里使用的是3.1版本

  4. 选择操作系统(因为欸使用的CentOS7,所以选择redhat7)并且指定HDP和HDP-UTILS的rpm的URL

  5. 输入节点主机名列表

  6. 等待服务器注册,然后点击NEXT

  7. 选择要安装的大数据组件

  8. 选择每个节点具体安装的组件

  9. 设置服务对应的密码

  10. 配置大数据组件参数,这个根据需求配置即可,如果不了解大数据组件的相关配置可以先使用默认,后续可通过查证资料进行更改配置

  11. 配置完成后点击安装即可

  12. 安装完成

Ambari-2.7.4和HDP-3.1.4安装(附Ambari和HDP安装包)相关推荐

  1. ubuntu 18.04安装hdp 3.1.0最新完整版(含安装包)

    节点准备 hostname ip 角色 ubuntu-1804-1 172.21.73.53 从节点 ubuntu-1804-2 172.21.73.54 主节点 ubuntu-1804-3 172. ...

  2. Ambari 2.7.3 + HDP 3.1.0 安装

    文章目录 1. Ambari和HDP安装 1.1 兼容情况 1.2 安装环境 1.3 集群规划 2. 搭建虚拟机 2.1 安装时间同步服务ntp 2.2 关闭THP 2.3 最大打开文件要求 2.4 ...

  3. 基于HDP版本的YDB安装部署

    第三章 YDB依赖环境准备 一.硬件环境 硬件如何搭配,能做到比较高的性价比,不存在短板.合理的硬件搭配,对系统的稳定性也很关键. 1.CPU不是核数越高越好,性价比才是关键. 经常遇到很多的企业级客 ...

  4. 基于HDP版本的YDB安装部署(转)

    第三章 YDB依赖环境准备 一.硬件环境 硬件如何搭配,能做到比较高的性价比,不存在短板.合理的硬件搭配,对系统的稳定性也很关键. 1.CPU不是核数越高越好,性价比才是关键. 经常遇到很多的企业级客 ...

  5. Ambari 2.7.5+HDP3.1.5离线安装详细教程(附安装包)

    一.准备工作 系统:centos7.6(推荐使用:redhat7.redhat-ppc7.ubuntu14.ubuntu16.ubuntu18) Ambari版本: 2.7.5 HDP版本:3.1.5 ...

  6. HDP(Hortonworks Data Platform) 安装

    HDP(Hortonworks Data Platform) : 集成了许多apache的许多大数据分布式的内容,像hadoop spark yarn hdfs kafka等工具. HDP(Horto ...

  7. 安装Ambari 2.7.5 + HDP3.1.5(附安装包)

    目录: 前置准备 1. 安装包准备 2.服务器配置 3.配置静态IP 4.配置主机名 5.关闭防火墙及selinux 6.配置ssh互信 7.安装pssh工具(非必须) 8. 配置ntp时钟同步 9. ...

  8. ambari hdfs 启动报错_Ambari 1.6 自动安装hadoop 2.2.0 在Ambari启动namenode时报错

    展开全部 lib/ambari-agent/data/, ',587 - Modifying group nobody 2015-03-11 09;cache/:34:49;python2: Fals ...

  9. Hdp + Ambari 本地源安装

    一.安装虚拟服务器(VM12中安装centos7) Hdpm (先安装一台服务器,后面再通过克隆的方式进行服务器的复制) 二.安装jdk 1. 下载jdk1.8安装包2. 将文件传到指定目录jdk-8 ...

最新文章

  1. DLL load failed: 页面文件太小,无法完成操作
  2. Spring配置iBatis多个SqlMapConfig.xml
  3. 世界首富比尔·盖茨的母亲有多厉害?
  4. Redis工作笔记-Hash类型
  5. net 架构师-数据库-sql server-003-T-SQL 基本语句
  6. SNS类游戏cache server设计浅析
  7. 《学习之道》第十章学习方法28再次提到番茄时间
  8. 数据猿专访诸葛io孔淼:数据与业务“动态”结合才能发挥最大威力
  9. Pyflink系列之使用pyflink实现flink大数据引挚的经典案例wordcount
  10. 精囊妙计 -- 策略模式(Strategy Pattern) 介绍 优缺点 使用场景案例及代码演示
  11. python爬虫selenium-前程无忧
  12. 【人脸识别】LPP人脸特征提取【含GUI Matlab源码 1491期】
  13. MYSQL存储过程梳理
  14. c语言中if( k1)的含义,C语言:我的按键程序K1键按下没有反应,其他两个都有反应...
  15. 【Aegisub相关】Lua程序设计 第4版(中文翻译)
  16. 【调剂】内蒙古农业大学2020年硕士研究生调剂公告(一)
  17. IPSEC ×××连连看
  18. CS231n - Assignment2 Tensorflow
  19. win10下从源码运行Cura——环境配置(二次开发准备工作)
  20. 转:高绩效团队应该如何带?关注具体的体验,胜过抽象的文化

热门文章

  1. conda常用命令(Anaconda Prompt管理员身份运行)
  2. mysql创建角色集_mysql8之新增角色
  3. 【Java学习日志3.31】经典扫雷带界面完整版
  4. 计算组合数公式nCr的实现方法和源代码
  5. PyQt5 鼠标点击事件(点击响应事件可自定义):鼠标单击、双击、滚轮滚动、释放、移动等
  6. Zemax操作--3(玻璃库和自定义)
  7. wikipeida 关于正则表达式的解释
  8. 广读精思:科学新闻那些事
  9. css滤镜属性渐变_使用滤镜对CSS渐变进行动画处理
  10. C语言中文网课后作业day01