yarn配置启动
2017-10-27 本文已影响0人
0_9f3a
1.配置 mapred-site.xml(集群所有文件)
进入目录 /usr/local/hadoop/etc/hadoop/
vim /usr/local/hadoop/etc/hadoop/mapred-site.xml
写入
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
2.配置yarn-site.xml(集群所有文件)
进入目录 /usr/local/hadoop/etc/hadoop/
vim /usr/local/hadoop/etc/hadoop/yarn-site.xml
写入
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.auxservices.mapreduce.shuffle.class</name> <value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>
<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>slave2</value>
</property>
<property>
<name>yarn.resourcemanager.hostname.rm2</name>
<value>slave3</value>
</property>
<property>
<name>yarn.resourcemanager.zk-address</name>
<value>slave1:2181,slave2:2181,slave3:2181</value>
</property>
3.yarn启动
master上执行 start-all.sh
此时nodemanager和resourcemanager不会启动,需要在master上:
yarn-daemon.sh start nodemanager
在slaveX上:
yarn-daemon.sh start resourcemanager
运行JPS发现master上有nodemanager,slaveX上有resourcemanager。则yarn启动完成。