Hadoop集群的搭建准备

这里我们使用免费软件MobaXterm来搭建

1、首先分别将三台虚拟机开机,然后使用MobaXterm-Session-SSH来分别链接三台虚拟机

 

2、 在Remote host * 中输入我们之前创建虚拟机的IP地址(输入IP后点击OK),然后分别链接3台虚拟机

 

 3、然后进入我们登录界面

 4、这是输入我们的账号和密码

 5、登陆成功后便可进入界面

 接下里开始我们的重点

1.三台虚拟机关闭防火墙
关闭防火墙,并禁止开机自启动
停止firewall
systemctl stop firewalld.service 
禁止firewall开机启动
systemctl disable firewalld.service 
查看firewall状态
systemctl status firewalld.service

2.三台机器关闭selinux

临时关闭
setenforce 0
查看SELinux状态
getenforce
永久关闭
vi /etc/sysconfig/selinux

3、三台机器更改主机名(这里我将用node01,node02,node03分别给三台虚拟机命名)

  hostnamectl set-hostname node01

  hostnamectl set-hostname node02

  hostnamectl set-hostname node03

 4、三台机器做主机名与IP地址的映射

vi /etc/hosts

192.168.66.210 node01.hadoop.com node01
192.168.66.220 node02.hadoop.com node02
192.168.66.230 node03.hadoop.com node03

5、三台机器机器免密码登录

在三台机器执行以下命令,生成公钥与私钥

ssh-keygen -t rsa

执行该命令之后,按下三个回车即可

 三台机器将拷贝公钥到第一台机器

三台机器执行命令:
ssh-copy-id node01

  将第一台机器的公钥拷贝到其他机器上

在第一台机器上面指向以下命令
scp /root/.ssh/authorized_keys node02:/root/.ssh
scp /root/.ssh/authorized_keys node03:/root/.ssh

  6.三台机器时钟同步

yum install ntp -y  //安装ntp服务

systemctl enable ntpd //开机启动服务

systemctl start ntpd //启动服务

timedatectl set-timezone Asia/Shanghai //更改时区

timedatectl set-ntp yes //启用ntp同步

ntpq -p //同步时间

  以上就是Hadoop环境搭建的准备工作

  

原文地址:https://www.cnblogs.com/wei-520/p/13068461.html