一、环境准备
Property | 主控终端 | 计算终端1 | 计算终端2 | 计算终端3 | 计算终端4 | 计算终端5 | 计算终端3 |
主机名 | master.hadoop | ambari01.hadoop | ambari02.hadoop | ambari03.hadoop | ambari04.hadoop | ambari05.hadoop | ambari06.hadoop |
ip地址 | 192.168.1.30 | 192.168.1.31 | 192.168.1.32 | 192.168.1.33 | 192.168.1.34 | 192.168.1.35 | 192.168.1.36 |
子网掩码 | 24 | 24 | 24 | 24 | 24 | 24 | 24 |
网关 | 192.168.0.1 | 192.168.0.1 | 192.168.0.1 | 192.168.0.1 | 192.168.0.1 | 192.168.0.1 | 192.168.0.1 |
DNS | 114.114.114.114 | 114.114.114.114 | 114.114.114.114 | 114.114.114.114 | 114.114.114.114 | 114.114.114.114 | 114.114.114.114 |
nohup wget -c http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.2.0/ambari.repo \ http://public-repo-1.hortonworks.com/HDP-GPL/centos7/2.x/updates/2.6.5.0/HDP-GPL-2.6.5.0-centos7-gpl.tar.gz \ http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.5.0/HDP-2.6.5.0-centos7-rpm.tar.gz \
http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.6.2.0/ambari-2.6.2.0-centos7.tar.gz \ http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7/HDP-UTILS-1.1.0.22-centos7.tar.gz \
http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.5.0/hdp.repo \ http://public-repo-1.hortonworks.com/HDP-GPL/centos7/2.x/updates/2.6.5.0/hdp.gpl.repo &
二、环境部署
所有机器执⾏:1.配置静态IP、DNS ⾸先,进⼊到⽹卡,然后编辑。 vim /etc/sysconfig/network-scripts/ifcfg-eth0 配置完静态IP后重启⽹络服务 systemctl restart network.service
2.配置主机名 # vim /etc/hostname HOSTNAME= 主机名 或者: hostnamectl set-hostname master.hadoop hostnamectl set-hostname ambari01.hadoop hostnamectl set-hostname ambari02.hadoop hostnamectl set-hostname ambari03.hadoop hostnamectl set-hostname ambari04.hadoop hostnamectl set-hostname ambari05.hadoop hostnamectl set-hostname ambari06.hadoop
3. 配置hosts⽂件 [root@master ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.1.30 master master.hadoop 192.165.1.31 ambari01 ambari01.hadoop 192.165.1.32 ambari02 ambari02.hadoop 192.165.1.33 ambari03 ambari03.hadoop 192.165.1.34 ambari04 ambari03.hadoop 192.165.1.35 ambari05 ambari03.hadoop 192.165.1.36 ambari06 ambari03.hadoop
4 .关闭防⽕墙与SElinux systemctl disable firewalld.service systemctl stop firewalld.service 关闭selinux vim /etc/sysconfig/selinux # 将SELINUX=enforcing改为SELINUX=disabled
统⼀把所有机器重启⼀遍!让配置⽣效!
5. SSH⽆密码登陆 在master节点执⾏如下命令: ssh-keygen -t rsa (回⻋后再按连续三个回⻋) cd .ssh/ cat id_rsa.pub >> authorized_keys 分别在其他三台机器上创建/root/.ssh⽬录, 如下: mkdir /root/.ssh 然后将authorized_keys拷⻉到其他几台机器的.ssh⽬录, 如下: scp authorized_keys ambari01:/root/.ssh/ scp authorized_keys ambari02:/root/.ssh/ scp authorized_keys ambari03:/root/.ssh/ 或者: ssh-copy-id -i ~/.ssh/id_rsa.pub ambari01 ssh-copy-id -i ~/.ssh/id_rsa.pub ambari02 ssh-copy-id -i ~/.ssh/id_rsa.pub ambari03
验证配置:
ssh ambari01 date; ssh ambari02 date; ssh ambari03 date;
5. 修改YUM源(可选)
mkdir /etc/yum.repos.d/backup mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup/ wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo yum clean all && yum makecache fast