部署大数据平台详细教程以及遇到的问题解答(ubuntu18.04下安装ambari2.7.3+HDP3.1.0)

节点准备:
我搭建的是3台,节点可以随意。建议最少是3台
hostname ip 角色
ubuntu-1804-1 172.21.73.53 从节点
ubuntu-1804-2 172.21.73.54 主节点
ubuntu-1804-3 172.21.73.55 从节点

一:关闭所有节点的防火墙

sudo ufw disable

二:配置时钟同步NTP
所有节点安装ntp

sudo apt install ntp

以ubuntu-1804-2为server,在ubuntu-1804-2进行如下修改(所有节点全部执行

修改配置文件vim /etc/ntp.conf,将下述配置注释:

#pool 0.ubuntu.pool.ntp.org iburst
#pool 1.ubuntu.pool.ntp.org iburst
#pool 2.ubuntu.pool.ntp.org iburst
#pool 3.ubuntu.pool.ntp.org iburst
 
#pool ntp.ubuntu.com

从节点添加如下:

server ubuntu-1804-2 prefer

启动ntp服务

systemctl enable ntp
systemctl start ntp

三:配置免密登录(root用户之间的)
1.使用普通用户进入root用户

sudo su

2.设置root密码

passwd root

3.修改配置

vim /etc/ssh/sshd_config

4.新增如下配置:

PermitRootLogin yes

5.重启ssh

systemctl restart sshd

ubuntu-1804-2可以免密登陆ubuntu-1804-1、ubuntu-1804-2、ubuntu-1804-3
root@ubuntu-1804-2:~# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
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:2MRn3ranRz0AFjMqx1t3Qk5QibTnPrw+zR9MY9ftu6s root@ubuntu-1804-3
The key’s randomart image is:
±–[RSA 2048]----+
| .*=+. |
| … .+B. |
| .o++o.= . |
| +o+o.+.o o|
| . S… o…=+|
| .o.=o+|
| .=+oo|
| ++oo|
| oEo+=|
±—[SHA256]-----+
执行上面的命令会生成公要私钥
在ubuntu-1804-2中进入root用户,执行如下命令,提示输入root密码,请输入root密码:

ssh-copy-id ubuntu-1804-1
ssh-copy-id ubuntu-1804-2
ssh-copy-id ubuntu-1804-3

至此,ubuntu-1804-2可以用root用户成功免密登陆ubuntu-1804-1、ubuntu-1804-2、ubuntu-1804-3
注意:此处有的会出现ssh-copy-id 复制不到从节点:
可以手动复制:
在这里插入图片描述
把主节点红括号的公钥复制到其他节点的绿括号文件中,如果没有这个文件,可以touch 新建一下。</

猜你喜欢

转载自blog.csdn.net/leaning_java/article/details/133032429