【总结】Fair Scheduler

简介:

Fair Scheduler总结

默认公平调度调度策略仅仅基于内存资源,通过使用DRF(Dominant Resource Fairness)能够配置基于内存和CPU资源任务调度。

当只有一个应用运行的时候,该应用能够使用整个集群。当其他应用提交到集群,空闲出来的资源将分配给新提交的应用,这样每个应用能够得到大致相同的资源。Hadoop默认调度器,形成一个应用的队列,如此小应用可以在一个合理时间范围内完成,并且不会让大应用长时间等待资源。这也是一个合理方式在许多用户中分享集群资源。最后,公平调度可以设置应用的优先度,设置优先度权重决定应用占用资源比例。

可插入策略的分层队列

公平调度支持分层队列,所有的队列从root队列延伸。典型的公平调度方式是把可用资源分布在可用的root队列的子队列当中。应用程序只能在叶子队列中被调度。一个队列可以被指定为其他队列的子队列。指定一个有层级的队列需要同时指定上级队列。例如 root.queue1   root.queue1.queue2。

公平调度可以配置自定义的调度策略,比如FifiPolicy,FairSharePolicy,DominantResourceFairnessPolicy

使用公平调度需要在yarn-site.xml中配置如下内容

1
2
3
4
< property >
   < name >yarn.resourcemanager.scheduler.class</ name >
   < value >org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler</ value >
</ property >


配置公平调度主要包含两个文件,首先是yarn-site.xml,在Hadoop配置目录下,其次需要创建一个配置文件fair-scheduler.xml,主要配置队列的权重和资源容量等。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<? xml  version = "1.0" ?>
< allocations >
   < queue  name = "sample_queue" >
     < minResources >10000 mb,0vcores</ minResources >
     < maxResources >90000 mb,0vcores</ maxResources >
     < maxRunningApps >50</ maxRunningApps >
     < maxAMShare >0.1</ maxAMShare >
     < weight >2.0</ weight >
     < schedulingPolicy >fair</ schedulingPolicy >
     < queue  name = "sample_sub_queue" >
       < aclSubmitApps >charlie</ aclSubmitApps >
       < minResources >5000 mb,0vcores</ minResources >
     </ queue >
   </ queue >
 
   < queueMaxAMShareDefault >0.5</ queueMaxAMShareDefault >
   < queueMaxResourcesDefault >40000 mb,0vcores</ queueMaxResourcesDefault >
 
   <!-- Queue 'secondary_group_queue' is a parent queue and may have
        user queues under it -->
   < queue  name = "secondary_group_queue"  type = "parent" >
   < weight >3.0</ weight >
   </ queue >
 
   < user  name = "sample_user" >
     < maxRunningApps >30</ maxRunningApps >
   </ user >
   < userMaxAppsDefault >5</ userMaxAppsDefault >
 
   < queuePlacementPolicy >
     < rule  name = "specified"  />
     < rule  name = "primaryGroup"  create = "false"  />
     < rule  name = "nestedUserQueue" >
         < rule  name = "secondaryGroupExistingQueue"  create = "false"  />
     </ rule >
     < rule  name = "default"  queue = "sample_queue" />
   </ queuePlacementPolicy >
</ allocations >


队列访问控制列表

ACLs对队列进行控制,管理哪些用户可以访问特定队列。主要包括了aclSubmitApps 和aclAdministerApps配置项,每个队列都可以配置这两个 参数。





     本文转自巧克力黒 51CTO博客,原文链接:http://blog.51cto.com/10120275/1979642,如需转载请自行联系原作者
相关文章
|
5天前
|
Kubernetes 监控 调度
K8S中Scheduler原理分析
【6月更文挑战第20天】K8S Scheduler是集群的关键组件,它监听API Server,为新Pod选择合适的Node。
|
5天前
|
安全 机器人 Java
scheduleatfixedrate详解
scheduleatfixedrate详解
|
5天前
|
Java BI 调度
ScheduledThreadPoolExecutor详解
ScheduledThreadPoolExecutor详解
|
1月前
|
调度
APScheduler任务相关操作
APScheduler任务相关操作
24 0
|
1月前
|
资源调度 分布式计算 算法
Gang Scheduling
Gang Scheduling(Coscheduling)、FIFO Scheduling、Capacity Scheduling、Fair sharing、Binpack/Spread等是云计算和分布式系统中的任务调度算法,用于在资源有限的情况下,公平、高效地分配任务和资源。下面是这些调度算法的基本介绍和如何在实际应用中使用它们的一些建议:
130 2
|
6月前
|
Kubernetes 算法 调度
基于kube-scheduler-simulator编写自己的调度程序
基于kube-scheduler-simulator编写自己的调度程序
78 0
|
8月前
ScheduledThreadPoolExecutor
ScheduledThreadPoolExecutor
27 0
|
Java 调度
ScheduledExecutorService使用介绍
JUC包(java.util.concurrent)中提供了对定时任务的支持,即ScheduledExecutorService接口。 本文对ScheduledExecutorService的介绍,将基于Timer类使用介绍进行,因此请先阅读Timer类使用介绍文章。
1029 1
|
API 调度 Perl
kube-scheduler
kube-scheduler
130 0