一、介绍
- 类名:容量调度器
- org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.CapacityScheduler
- 配置文件:capacity-scheduler.xml
二、配置文件解析
<configuration>
<property>
<name>yarn.scheduler.capacity.maximum-applications</name>
<value>10000</value>
</property>
<property>
<name>yarn.scheduler.capacity.maximum-am-resource-percent</name>
<value>0.1</value>
</property>
<property>
<name>yarn.scheduler.capacity.resource-calculator</name>
<value>org.apache.hadoop.yarn.util.resource.DefaultResourceCalculator</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.queues</name>
<value>default</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.default.capacity</name>
<value>100</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.default.user-limit-factor</name>
<value>1</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.default.maximum-capacity</name>
<value>100</value>
</property>
</configuration>
三、实例讲解
-
添加3个队列,名字为a,b,c,这三个队列必须放在root队列中 <property>
<name>yarn.scheduler.capacity.root.queues</name>
<value>a,b,c</value>
</property>
-
指定这3个队列占用资源的比例,他们的和必须是100% <property>
<name>yarn.scheduler.capacity.root.a.capacity</name>
<value>40</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.b.capacity</name>
<value>20</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.c.capacity</name>
<value>40</value>
</property>
-
定义2个子队列a1和a2,设置他们的资源比例 <property>
<name>yarn.scheduler.capacity.root.a.queues</name>
<value>a1,a2</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.a.a1.capacity</name>
<value>40</value>
</property>
<property>
<name>yarn.scheduler.capacity.root.a.a2.capacity</name>
<value>60</value>
</property>
-
结果
|