目录
一、Ambari 简介
Ambari为您的集群提供了端到端的管理和监视解决方案。使用Ambari Web UI和REST API,您可以从中心位置部署,操作,管理配置更改以及监视群集中所有节点的服务。
二、软件准备
1. 软件要求
注意:Ambari 2.7.4仅支持HDP-3.1.4和HDF-3.2.0,并且JDK必须满足 JDK1.8
可以通过这个网站 https://supportmatrix.hortonworks.com 来确定 Ambari 不同版本对不同产品版本的支持。
组件 | 描述 |
---|---|
虚拟操作系统 | Centos 7.6 |
Ambari | 2.7.4.0 |
HDP | 3.1.4.0 |
HDP-GPL | 3.1.4.0 |
HDP-UTILS | 1.1.0.22 |
MySQL | 5.7 |
OracleJDK8 | JDK 1.8.0_77 |
X86 | X86-64 |
2. Ambari 软件包下载
Ambari 2.7.4:http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.4.0/ambari-2.7.4.0-centos7.tar.gz
HDP-3.1.4.0:
- HDP:http://public-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.1.4.0/HDP-3.1.4.0-centos7-rpm.tar.gz
- HDP-UTILS:http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7/HDP-UTILS-1.1.0.22-centos7.tar.gz
- HDP-GPL:http://public-repo-1.hortonworks.com/HDP-GPL/centos7/3.x/updates/3.1.4.0/HDP-GPL-3.1.4.0-centos7-gpl.tar.gz
OracleJDK8 1.8.0_77:https://www.oracle.com/technetwork/cn/java/javase/downloads/java-archive-javase8-2177648-zhs.html
三、搭建HDP集群
Hostname | IP | Functions | 内存 | 磁盘 |
---|---|---|---|---|
zh-master.hdp | 192.168.121.77 |
|
3G | 60G |
zh-node1.hdp | 192.168.121.100 |
|
2G | 60G |
1. 搭建 Master 节点
搭建 Master 节点的虚拟机,然后进行克隆,完成HDP集群的基础环境搭建。
1.1 新建虚拟机
1.2 配置虚拟机网络
搭建HDP集群时最好配置静态网络,防止IP地址的变化造成搭建错误。
虚拟机最好是能联通外网,简单来说就是 虚拟机能ping 通百度,这样我们就可以直接配置yum源进行安装包下载。
参考:
1.3 关闭防火墙 firewalld 和 Selinux
// 暂停防火墙服务
# systemctl stop firewalld.service
// 设置防火墙服务开机不自启
# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
// 查看防火墙服务开机不自启是否设置成功,disabled表示设置成功
# systemctl is-enabled firewalld.service
disabled
// 查看防火墙状态
# systemctl status firewalld.service
修改selinux的enforcing为disabled
// 将文件中的enforcing替换为disabled,并删除文件中的#注释和空行
# sed -i -e 's/enforcing/disabled/g' -e '/^#/d' -e '/^$/d' /etc/selinux/config
// 临时生效selinux设置
# setenforce 0
// 查看selinux状态
# getenforce
Permissive
// 查看selinux状态
# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: disabled
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 31
1.4 修改host
# echo -e "192.168.200.10 zh-master.hdp zh-master \n192.168.200.20 zh-node1.hdp zh-node1" >> /etc/hosts
1.5 设置阿里云的yum源
访问:https://opsx.alibaba.com/mirror
选择 centos 点击 帮助
提示:wget 命令需要下载,建议使用 curl -o
// 备份yum源
# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
// 下载阿里云repo文件
# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
// 生成缓存
# yum makecache
1.6 安装时间同步服务 NTP
// 安装 ntp 服务
# yum install -y ntp
// 开启并设置开机自启ntp服务
# systemctl start ntpd
# systemctl enable ntpd
// 查看ntp服务状态
# systemctl status ntpd