当前位置:首页 > 开发 > 开源软件 > 正文

【Hadoop八】Yarn的资源调度策略

发表于: 2015-03-07   作者:bit1129   来源:转载   浏览:
摘要: 1. Hadoop的三种调度策略 Hadoop提供了3中作业调用的策略, FIFO Scheduler Fair Scheduler Capacity Scheduler 以上三种调度算法,在Hadoop MR1中就引入了,在Yarn中对它们进行了改进和完善.Fair和Capacity Scheduler用于多用户共享的资源调度   2. 多用户资源共享的调度

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.

【Hadoop八】Yarn的资源调度策略

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

编辑推荐
hadoop支持多用户环境,在生产环境中,往往一个大的hadoop集群,供多个应用如Hive,Mahout等之类的
中国第一个在线Hadoop教育平台—小象学院,推荐给Hadoop初学者和实践者,网址是:http://www.chinah
在YARN中,资源调度器(ResourceScheduler)是一个非常核心的部件,它负责将各个节点上的资源封装成
带有 MapReduce 的 Apache Hadoop 是分布式数据处理的骨干力量。借助其独特的横向扩展物理集群架构
带有 MapReduce 的 Apache Hadoop 是分布式数据处理的骨干力量。借助其独特的横向扩展物理集群架构
带有 MapReduce 的 Apache Hadoop 是分布式数据处理的骨干力量。借助其独特的横向扩展物理集群架构
资源调度器是Hadoop集群中一个比较重要的模块,最初的hadoop资源调度器是基于队列形式的FIFO调度的
Hadoop MapReduceV2(Yarn) 框架简介 原 Hadoop MapReduce 框架的问题 对于业界的大数据存储及分布式
YARN最初设计是为了解决Hadoop中MapReduce计算框架中的资源管理问题,但现在它已经是一个更加通用的
本文主要介绍以下几个知识: 一、老的 hadoop框架存在的问题 二、yarn框架的优势 三、yarn框架中几
版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号