Ambari2.6.0+HDP2.6.3部署Hadoop集群

一.环境准备

1.修改hostname(所有节点)
  • 临时生效

    [root@localhost ~] hostname localhost
  • 永久生效

    [root@localhost ~] vi /etc/hosts
    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
    192.168.31.11 hdm01.xx.cn hdm01
    192.168.31.12 hdm02.xx.cn hdm02
    192.168.31.13 hddata01.xx.cn hddata01
2.配置SSH免密(所有节点)
  • 生成秘钥(所有节点都生成一份)

    [root@localhost ~] cd ~
    [root@localhost ~] mkdir .ssh
    [root@localhost ~] cd .ssh
    [root@localhost .ssh] ssh-keygen -t rsa #生成秘钥
  • 配置免密互通(主节点下操作)

    [root@localhost .ssh] cat id_rsa.pub >> authorized_keys
    #分别把上一步各个节点生成的公共秘钥追加到主节点的/root/.ssh/authorized_keys中
    [root@localhost .ssh] ssh hostname cat /root/.ssh/id_rsa.pub >> authorized_keys 
    #把主节点上已汇总到所有节点公共秘钥的/root/.ssh/authorized_keys分发到各个节点/root/.ssh/下
    [root@localhost .ssh] scp ./authorized_keys hostname:/root/.ssh/ 
    [root@localhost .ssh] chmod 600 ~/.ssh
    [root@localhost .ssh] chmod 600 ~/.ssh/authorized_keys
3.开启NTP服务(所有节点)
  • 关闭chronyd服务

    #临时关闭
    [root@localhost ~] systemctl stop chronyd    
    #永久关闭 
    [root@localhost ~] systemctl disable chronyd
  • 开启NTP服务

    #查看是否已安装NTP
    [root@localhost ~] rpm -qa |grep ntp
    #如未安装,则安装NTP    
    [root@localhost ~] yum install ntp
    #启动NTP服务
    [root@localhost ~] systemctl start ntpd
    #开启开机自动启动NTP服务
    [root@localhost ~] systemctl enable ntpd
    #查看NTP服务状态
    [root@localhost ~] systemctl status ntpd
4.配置FQDN(所有节点)
[root@localhost ~] vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost
5.允许HTTP通过防火墙(所有节点)
[root@localhost ~] rpm -qa |grep http                          #查看是否安装http
[root@localhost ~] yum -y install httpd                        #如未安装,则安装
[root@localhost ~] firewall-cmd --add-service=http             #临时开放http
[root@localhost ~] firewall-cmd --permanent --add-service=http #永久开放http
[root@localhost ~] systemctl start httpd.service               #临时添加服务随系统自动启动
[root@localhost ~] systemctl enable httpd.service              #永久添加服务随系统自动启动

相关推荐