配置部署环境

  1. 依次登录节点1~4,将节点的主机名分别修改为server1、agent1、agent2、agent3。

    1
    hostnamectl set-hostname 主机名 --static
    

  2. 登录所有节点,添加集群所有节点的“地址-主机名”映射关系。

    1. 打开“/etc/hosts”文件。
      1
      vi /etc/hosts
      
    2. “i”进入编辑模式,在hosts文件中添加以下内容。
      1
      2
      3
      4
      IPaddress1 server1
      IPaddress2 agent1
      IPaddress3 agent2
      IPaddress4 agent3
      
    3. “Esc”键,输入:wq!,按“Enter”保存并退出编辑。

  3. 登录所有节点,关闭防火墙。

    1
    2
    systemctl stop firewalld.service
    systemctl disable firewalld.service
    

  4. 登录所有节点,配置SSH免密登录。

    1. 生成密钥,遇到提示时,按“Enter”
      1
      ssh-keygen -t rsa
      
    2. 在每台机器上配置SSH免密登录(包括配置自身节点的免密)。
      1
      ssh-copy-id -i ~/.ssh/id_rsa.pub root@节点IP
      

  5. 请参见《Hive 移植指南》中“配置编译环境”章节完成环境配置。