配置部署环境
- 依次登录节点1~4,将节点的主机名分别修改为server1、agent1、agent2、agent3。
1
hostnamectl set-hostname 主机名 --static
- 登录所有节点,添加集群所有节点的“地址-主机名”映射关系。
- 打开“/etc/hosts”文件。
1
vi /etc/hosts
- 按“i”进入编辑模式,在hosts文件中添加以下内容。
1 2 3 4
IPaddress1 server1 IPaddress2 agent1 IPaddress3 agent2 IPaddress4 agent3
- 按“Esc”键,输入:wq!,按“Enter”保存并退出编辑。
- 打开“/etc/hosts”文件。
- 登录所有节点,关闭防火墙。
1 2
systemctl stop firewalld.service systemctl disable firewalld.service
- 登录所有节点,配置SSH免密登录。
- 生成密钥,遇到提示时,按“Enter”。
1
ssh-keygen -t rsa
- 在每台机器上配置SSH免密登录(包括配置自身节点的免密)。
1
ssh-copy-id -i ~/.ssh/id_rsa.pub root@节点IP
- 生成密钥,遇到提示时,按“Enter”。
- 请参见《Hive 移植指南》中“配置编译环境”章节完成环境配置。