Yarn集群搭建

2020-12-06  本文已影响0人  小左伯爵
NameNode DataNode ZK ZKFC JNN RS NM
node01 * * * *
node02 * * * * * * *
node03 * * * * * * *
node04 * * *

1.修改mapred-site.xml

[root@node01 hadoop]# vim mapred-site.xml
<configuration>
<property>
       <name>mapreduce.framework.name</name>
       <value>yarn</value>
</property>
</configuration>

2.修改yarn-site.xml

<configuration>
<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,rm3</value>
</property>
<property>
  <name>yarn.resourcemanager.hostname.rm1</name>
  <value>node01</value>
</property>
<property>
  <name>yarn.resourcemanager.hostname.rm2</name>
  <value>node02</value>
</property>
<property>
  <name>yarn.resourcemanager.hostname.rm3</name>
  <value>node03</value>
</property>
<property>
  <name>yarn.resourcemanager.webapp.address.rm1</name>
  <value>node01:8088</value>
</property>
<property>
  <name>yarn.resourcemanager.webapp.address.rm2</name>
  <value>node02:8088</value>
</property>
<property>
  <name>yarn.resourcemanager.webapp.address.rm3</name>
  <value>node03:8088</value>
</property>
<property>
  <name>hadoop.zk.address</name>
  <value>node02:2181,node03:2181,node04:2181</value>
</property>

</configuration>

3.分发配置

[root@node01 etc]# scp -r hadoop/ root@node02:`pwd`/
[root@node01 etc]# scp -r hadoop/ root@node03:`pwd`/
[root@node01 etc]# scp -r hadoop/ root@node04:`pwd`/

4.启动停止

[root@node01 sbin]# start-all.sh 
Starting namenodes on [node01 node02 node03]
Starting datanodes
Starting journal nodes [node01 node02 node03]
Starting ZK Failover Controllers on NN hosts [node01 node02 node03]
Starting resourcemanagers on [ node01 node02 node03]
Starting nodemanagers
#停止
[root@node01 sbin]# stop-all.sh
上一篇下一篇

猜你喜欢

热点阅读