- 1、关闭yarn, stop-yarn.sh
- 2、先备份$HADOOP_HOME/etc/hadoop/capacity-scheduler.xml
cp capacity-scheduler.xml capacity-scheduler.xml_bak
rm capacity-scheduler.xml
- 3、然后在这个配置中加上如下配置
vi capacity-scheduler.xml
:
yarn.scheduler.capacity.root.queues prod,dev yarn.scheduler.capacity.root.dev.queues eng,science yarn.scheduler.capacity.root.prod.capacity 40 yarn.scheduler.capacity.root.dev.capacity 60 yarn.scheduler.capacity.root.dev.maximum-capacity 75 yarn.scheduler.capacity.root.dev.eng.capacity 50 yarn.scheduler.capacity.root.dev.science.capacity 50
占比是百分比
- 4、然后进行同步:
scp capacity-scheduler.xml hadoop-twq@slave1:~/bigdata/hadoop-2.7.5/etc/hadoop/
scp capacity-scheduler.xml hadoop-twq@slave2:~/bigdata/hadoop-2.7.5/etc/hadoop/
- 5、启动yarn, start-yarn.sh
-
6、通过WebUI查看配置是否成功
-
在DistributedCount.java中MapReduce程序指定队列运行
job.getConfiguration().set("mapreduce.job.queuename", "eng");
运行中通过WebUI可以查看运行过程: