1. 必要性

Hadoop提供了多个配置参数使得admin和user可以灵活设定内存;有些参数有defaut-value, 有些选项是cluster specific以支持memory-intensive作业。

当构建一个cluster时,admin可以先设定一些appropriate default value;其他一些参数设定可根据cluster硬件配置(如任务可获得的物理内存和虚拟内存的总大小、slave配置的slots的数目、在slave上运行的process的需求)和作业类型(如内存密集型任务)而确定。

2. 内存监控

(1) 监控任务内存的目的

防止MapReduce task占用了过量的内存(consuming memory beyond a limit),从而导致同在该slave上运行的其他进程、其他任务、或者daemon(例如DataNode或者TaskTracker)。

(2) virtual memory和physical memory

Hadoop可以监控节点的virtual memory和physical memory,两者之间独立。然而,在streaming应用中,由于程序需要加载了libraries来执行任务,故virtual memory使用较多。在这种情况下,监控physical memory会更准确.

(3) hadoop允许为作业指定期望所需内存的最大值。通过resource aware scheduling and monitoring, hadoop tries to确保满足task数量,以满足限制

(a) an individual job's memory requirement

(b) the total amount of memory available for all MapReduce tasks

(4) TaskTracker 对task的监控

(a) 周期性的监控

第一步:以防某个task及其child process累计使用的virtual memory和physical memory的量不超过specified的量。先查virtual memory, 接着physical memory. 若超过,则kill该task及其child process。并标记该task为failed.

第二步:检查某个job的所有running tasks及其child processes累计使用的virtual memory和physical memory的量。若超过limit, 则kill以足够量的task,直到累计内存的使用量低于limit. (若virtual memory超限,则kill掉那些进展最小的tasks;若physical memory超限,则kill掉那些占用physical memory最多的task)。被kill掉的task被标记为killed.

(5) Resource aware scheduling

Resource aware scheduling能确保:要调度task到某个slave上前,先要确保该slave能够满足task的memory requirement。

Capacity Scheduling在调度作业时,把virtual memory的需求考虑进去。见

(6) Configuring Memory Requirements For A Job    在MapReduce的tutorial中

(7) cluster相关的内存配置

这些配置与JobTracker和TaskTracker相关,任何job不能修改这些参数。另外,配置参数在每个slave上相同。

  • mapreduce.cluster.{map|reduce}memory.mb: These options define the default amount of virtual memory that should be allocated for MapReduce tasks running in the cluster. They typically match the default values set for the options mapreduce.{map|reduce}.memory.mb. They help in the calculation of the total amount of virtual memory available for MapReduce tasks on a slave, using the following equation:
    Total virtual memory for all MapReduce tasks = (mapreduce.cluster.mapmemory.mb * mapreduce.tasktracker.map.tasks.maximum) + (mapreduce.cluster.reducememory.mb * mapreduce.tasktracker.reduce.tasks.maximum)
    Typically, reduce tasks require more memory than map tasks. Hence a higher value is recommended for mapreduce.cluster.reducememory.mb. The value is specified in MB. To set a value of 2GB for reduce tasks, set mapreduce.cluster.reducememory.mb to 2048.

  • mapreduce.jobtracker.max{map|reduce}memory.mb: These options define the maximum amount of virtual memory that can be requested by jobs using the parameters mapreduce.{map|reduce}.memory.mb. The system will reject any job that is submitted requesting for more memory than these limits. Typically, the values for these options should be set to satisfy the following constraint:
    mapreduce.jobtracker.maxmapmemory.mb = mapreduce.cluster.mapmemory.mb * mapreduce.tasktracker.map.tasks.maximum
    mapreduce.jobtracker.maxreducememory.mb = mapreduce.cluster.reducememory.mb * mapreduce.tasktracker.reduce.tasks.maximum

    The value is specified in MB. If mapreduce.cluster.reducememory.mb is set to 2GB and there are 2 reduce slots configured in the slaves, the value formapreduce.jobtracker.maxreducememory.mb should be set to 4096.

  • mapreduce.tasktracker.reserved.physicalmemory.mb: This option defines the amount of physical memory that is marked for system and daemon processes. Using this, the amount of physical memory available for MapReduce tasks is calculated using the following equation:
    Total physical memory for all MapReduce tasks = Total physical memory available on the system - mapreduce.tasktracker.reserved.physicalmemory.mb
    The value is specified in MB. To set this value to 2GB, specify the value as 2048.

  • mapreduce.tasktracker.taskmemorymanager.monitoringinterval: This option defines the time the TaskTracker waits between two cycles of memory monitoring. The value is specified in milliseconds.

Note: The virtual memory monitoring function is only enabled if the variables mapreduce.cluster.{map|reduce}memory.mb andmapreduce.jobtracker.max{map|reduce}memory.mb are set to values greater than zero. Likewise, the physical memory monitoring function is only enabled if the variable mapreduce.tasktracker.reserved.physicalmemory.mb is set to a value greater than zero.

转自http://blog.csdn.net/amaowolf/article/details/7188504

转载于:https://blog.51cto.com/daisy8867/1239274

Hadoop job任务分配相关推荐

  1. hadoop job 数量_Hadoop job任务分配

    1. 必要性Hadoop提供了多个配置参数使得admin和user可以灵活设定内存:有些参数有defaut-value, 有些选项是cluster specific以支持memory-intensiv ...

  2. 提升Hadoop计算能力的并行框架

    集算器是新型并行计算框架,它支持读写HDFS中的文件,可以通过并行框架将计算任务分担到多个节点中.它专注于加强Hadoop的计算能力,从而实现计算性能和开发效率更高的大数据应用. 更强的计算能力.Ha ...

  3. [ZZ]Map/Reduce hadoop 细节

    转自:Venus神庙原文:http://www.cnblogs.com/duguguiyu/archive/2009/02/28/1400278.html 分布式计算(Map/Reduce) 分布式计 ...

  4. Hadoop机架感知与balancer

    版本:Apache Hadoop 1.0.3 Hadoop集群节点通常会跨很多个机架,增加节点的情况时有发生,而且很多时候节点的磁盘容量还不统一,有大有小,所以集群节点非常容易出现磁盘利用不平衡的情况 ...

  5. 数据蒋堂 | Hadoop - 一把杀鸡用的牛刀

    作者:蒋步星 来源:数据蒋堂 本文共1800字,建议阅读6分钟. 通过本文为大家解读为什么Hadoop不适合小集群实现. Hadoop是个庞大的重型解决方案,它的设计目标本来就是大规模甚至超大规模的集 ...

  6. Hadoop 4、Hadoop MapReduce的工作原理

    一.MapReduce的概念 MapReduce是hadoop的核心组件之一,hadoop要分布式包括两部分,一是分布式文件系统hdfs,一部是分布式计算框就是mapreduce,两者缺一不可,也就是 ...

  7. Hadoop学习笔记:MapReduce框架详解

    原文:http://blog.jobbole.com/84089/ 原文出处: 夏天的森林 开始聊mapreduce,mapreduce是hadoop的计算框架,我学hadoop是从hive开始入手, ...

  8. [Hadoop in China 2011] 何鹏:Hadoop在海量网页搜索中应用分析

    何鹏是即刻搜索研发部系统平台组的工程师,即刻搜索是人民网其下的搜索引擎,由人民搜索转变而来,于今年6月20日正式上线.据何鹏介绍,即刻搜索 目前存放了200亿个文件以上,其整个系统架构采用Hadoop ...

  9. Hadoop详解(十一):Yarn设计理念与基本架构

    1. Yarn 产生背景 1.1 MRv1 的局限性 扩展性差:在MRV1中,jobtracker同时兼备了资源管理和作业控制两个功能,这成为系统的一个最大瓶颈,严重制约了hadoop集群扩展性. 资 ...

最新文章

  1. 移动H5前端性能优化指南[转]
  2. guava cache简单学习笔记
  3. wordpress 后台,登录,注册开启https的重写规则
  4. SANS:2012年度日志管理调查报告
  5. ldap接触(1)之如何把安全证书导入到java中的cacerts证书库
  6. php html asp .net iis tomcat,iis+apache+tomcat 整合共享80口 支持ASP .NET JSP PHP全能WEB服务...
  7. python的模块导入问题_python导入模块错误怎么解决
  8. Visual studio 2005 恢復默認設置的方法
  9. 教师节|祝所有可爱的讲师节日快乐!
  10. UINavigationBar的系统渲染方式
  11. 特斯拉皮卡,会大卖吗?
  12. Mysql 索引入门
  13. Delphi 中的MD5实现方法及delphi2009和delphi2010中用法
  14. springboot快速入门(Eclipse)
  15. 通过Web.config中的configSections配置自己系统的全局常量
  16. 结构风险最小和VC维理论的解释
  17. php+pdo分页类
  18. 2021年最值得学习的5款开源Java框架
  19. 获得碳中和认证的六个步骤
  20. 【编程之外】当遮羞布被掀开,当人们开始接受一切

热门文章

  1. php for循环建数据
  2. “安全宝”,云安全服务
  3. zabbix配置飞信报警
  4. SQL to ElasticSearch DSL
  5. 如何在Hadoop2上远程调试MapReduce
  6. 【细节实现 回文串12】LeetCode 564. Find the Closest Palindrome
  7. 【有返回值的回溯法】剑指offer——面试题66:矩阵中的路径(回溯法)
  8. ubuntu16.04装机7: 挂载机械硬盘
  9. tf.contrib.data.Dataset 读取数据的原理--buffer
  10. pytorch: nn.Sequential(func1,func2,func3)