设为首页 收藏本站
查看: 908|回复: 0

[经验分享] 【Hadoop八】Yarn的资源调度策略

[复制链接]

尚未签到

发表于 2016-12-9 08:50:09 | 显示全部楼层 |阅读模式
1. Hadoop的三种调度策略
  Hadoop提供了3中作业调用的策略,

  • FIFO Scheduler
  • Fair Scheduler
  • Capacity Scheduler
  以上三种调度算法,在Hadoop MR1中就引入了,在Yarn中对它们进行了改进和完善.Fair和Capacity Scheduler用于多用户共享的资源调度
2. 多用户资源共享的调度

  • 支持资源按比例、数目分配
  • 支持层级队列划分分配
  • 支持资源抢占
3. MR1 vs Yarn 资源调度
  Hadoop MR1的资源调度是将多维度的资源抽象成一维度的slot,资源调度的过程是将slot分配给Task的过程。何为slot?在Yarn中,Hadoop直接调度的是CPU和内存,丢弃slot概念
4. FIFO Scheduler
  FIFO Scheduler可以简单理解为Java的队列,比如LinkedQueue,它是Hadoop早期采用的资源调度策略,它的含义是集群同时只有一个作业运行,这个作业运行完成后,后面提交的作业将按照FIFO的策略依次被调度。FIFO Scheduler以集群资源独占的方式运行作业,这样的好处是一个作业可以充分利用所有的集群资源,但是对于运行时间短,重要性高或者交互式查询类MR作业,时间等待是个需要解决的问题。单一的FIFO调度实现简单,但是对于很多实际的场景并不满足要求。
5. 基于作业优先级的资源调度
  在FIFO Scheduler之后,出现了基于作业优先级的资源调度,它可以理解为Java的优先级队列,比如PriorityQueue,每当运行作业时,Hadoop从作业队列中取一个优先级最高的作业执行,作业的优先级设置方法有两种:一个是设置mapred.job.priority属性,一个是调用JobClient的setJobPriority方法。任务优先级可以通过如下常量指定:VERY_HIGH, HIGH, NORMAL, LOW, VERY_LOW(优先级从高到低)
6. Fair Scheduler
  Fair Scheduler目的是让多个作业提交者共享计算资源,即一个集群中可以同时运行多个作业。
  The Fair Scheduler aims to give every user a fair share of the cluster capacity over time. If a single job is running, it gets all of the cluster. As more jobs are submitted, free task slots are given to the jobs in such a way as to give each user a fair share of the cluster. A short job belonging to one user will complete in a reasonable time even while another user’s long job is running, and the long job will still make progress. Jobs are placed in pools, and by default, each user gets her own pool. A user who submits more jobs than a second user will not get any more cluster resources than the second, on average. It is also possible to define custom pools with guaranteed minimum capacities specified in terms of the number of map and reduce slots, and to set weightings for each pool. The Fair Scheduler supports preemption, so if a pool has not received its fair share for a certain period of time, the scheduler will kill tasks in pools running over capacity in order to give more slots to the pool running under capacity. The Fair Scheduler is a “contrib” module. To enable it, place its JAR file on Hadoop’s classpath by copying it from Hadoop’s contrib/fairscheduler directory to the lib directory. Then set the mapred.jobtracker.taskScheduler property to: org.apache.hadoop.mapred.FairScheduler The Fair Scheduler will work without further configuration, but to take full advantage of its features and learn how to configure it (including its web interface), refer to the README file in the src/contrib/fairscheduler directory of the distribution
7. Capacity Scheduler
  层级队列式资源调度
  The Capacity Scheduler takes a slightly different approach to multiuser scheduling. A cluster is made up of a number of queues (like the Fair Scheduler’s pools), which may be hierarchical (so a queue may be the child of another queue), and each queue has an allocated capacity. This is like the Fair Scheduler, except that within each queue, jobs are scheduled using FIFO scheduling (with priorities). In effect, the Capacity Scheduler Job Scheduling | 207 allows users or organizations (defined using queues) to simulate a separate MapReduce cluster with FIFO scheduling for each user or organization. In contrast, the Fair Scheduler  (which actually also supports FIFO job scheduling within pools as an option, making it like the Capacity Scheduler) enforces fair sharing within each pool, so running jobs share the pool’s resources.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-311699-1-1.html 上篇帖子: Commissioning and Decommissioning Nodes from Hadoop Cluster 下篇帖子: Hadoop MapReduce任务的启动分析
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表