集群规划
HDFS需要部署NameNode
和DataNode
YARN需要部署ResourceManager
和NodeManager
假设现在有三台服务器,规划方式如下:hadoop000 192.168.199.234
NameNode
DataNode
ResourceManager
NodeManager
hadoop001 192.168.199.235
NameNode
DataNode
hadoop002 192.168.199.236
NameNode
DataNode
配置
- 修改hostname(每台都要):
vim /etc/hostname
,将hostname分别改为hadoop000、hadoop001和hadoop002 - 配置hostname和ip的映射关系(每台都要):
vim /etc/hosts
e.g:假设当前机器是hadoop000,则配置如下:192.168.199.234 hadoop000 192.168.199.235 hadoop001 192.168.199.236 hadoop002 192.168.199.234 localhost
前置安装
-
ssh免密登录 (每台都要):
ssh-keygen -t rsa
-
机器间免密登录(只要hadoop000):
ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop000 ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop001 ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop002
第一次执行需要密码,后续就不用输密码了
-
JDK、Hadoop安装(每台都要)