集群部署模型
修改配置文件
[root@node01 hadoop]# cp mapred-site.xml.template mapred-site.xml
[root@node01 hadoop]# vi mapred-site.xml
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
[root@node01 hadoop]# vi yarn-site.xml
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.resourcemanager.ha.enabled</name>
<value>true</value>
</property>
<property>
<name>yarn.resourcemanager.cluster-id</name>
<value>cluster1</value>
</property>
<property>
<name>yarn.resourcemanager.ha.rm-ids</name>
<value>rm1,rm2</value>
</property>
<property>
<name>yarn.resourcemanager.hostname.rm1</name>
<value>node03</value>
</property>
<property>
<name>yarn.resourcemanager.hostname.rm2</name>
<value>node04</value>
</property>
<property>
<name>yarn.resourcemanager.zk-address</name>
<value>node02:2181,node03:2181,node04:2181</value>
</property>
分发配置文件
[root@node01 hadoop]# scp mapred-site.xml yarn-site.xml node02:/opt/hadoop/hadoop-2.6.5/etc/hadoop/
[root@node01 hadoop]# scp mapred-site.xml yarn-site.xml node03:/opt/hadoop/hadoop-2.6.5/etc/hadoop/
[root@node01 hadoop]# scp mapred-site.xml yarn-site.xml node04:/opt/hadoop/hadoop-2.6.5/etc/hadoop/
开启yarn集群
[root@node01 hadoop]# start-yarn.sh
![](https://i-blog.csdnimg.cn/blog_migrate/05e10e9b0f14f6a778a16d921231a321.png)
在node03,node04开启resourcemanager
[root@node03 ~]# yarn-daemon.sh start resourcemanager
[root@node04 ~]# yarn-daemon.sh start resourcemanager
访问WEB端口
重定向node03![](https://i-blog.csdnimg.cn/blog_migrate/17ce846affc4c3934a48b194e9e3efad.png)
查看node04的状态信息