本文参考网上其他教程修改而来(小编使用的是现成的docker镜像,之前已经完成了基础步骤安装,也不想重复搞一遍了,只能拿别人家的给大家参考了,内容都差不多的),适合有Ambari安装经验的人参考,初学者如果按照步骤一步一步操作,可能会遇到一些问题,不过有问题不要怕,在解决问题的过程中才能成长。
1. 环境及软件准备
本文以x86版本为例进行。
Ambari-2.7.6和HDP-3.3.1下载 ,关注HidataPlus公众号,
留言“下载”获取最新网盘链接
环境:CentOS7.6(x86_64)、三台服务器(自建虚机、公有云、docker都可以),建议平均每台机器不能不低于2C12G,60G可用磁盘(如果是单机使用Docker镜像,单机应不低于4C32G,120G可用磁盘空间。
软件:mysql5.7+、jdk8、ambari-2.7.6.3-centos7-x86_64.tar.gz、HDP-3.3.1.0-001-centos7-x86_64.tar.gz、HDP-UTILS-1.1.0.22-centos7-x86_64.tar.gz
2. 准备工作
2.1 关闭防火墙
systemctl status firewalld # 通过此命令查看防火墙状态systemctl stop firewalld # 关闭防火墙systemctl disable firewalld # 关闭防火墙开机自启
2.2 配置域名映射
确定好三台服务器的名称为hdp1、hdp2、hdp3,通过etc下的hosts文件配置域名映射
vi /etc/hosts #通过修改此文件来配置域名映射,文件内容如下
192.168.80.xxx hdp3 #域名映射
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 #域名映射
三台虚拟的域名映射要相同,配置完一台虚拟机的域名映射后,可通过scp命令将hosts文件发送到其他虚拟机
scp /etc/hosts hdp2:/etc/
scp /etc/hosts hdp3:/etc/
2.3 配置免密
三台虚拟机之间要进行免密配置
生成本机公钥
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]-----+
将本公钥发送给其他虚拟机
# 公钥也要发给自己
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: 1
Now try logging into the machi