手机版
你好,游客 登录 注册
背景:
阅读新闻

Hadoop Map/Reduce内存限制

[日期:2012-06-19] 来源:Linux社区  作者:rzhzhz [字体: ]

如何设置Hadoop  Map/Reduce任务的内存限制?

Parameter

Type

Meaning

mapred.cluster.map.memory.mb set by admin, cluster-wide Cluster definition of memory per map slot. The maximum amount of memory, in MB, each map task on a tasktracker can consume.
mapred.cluster.reduce.memory.mb set by admin, cluster-wide Cluster definition of memory per reduce slot. The maximum amount of memory, in MB, each reduce task on a tasktracker can consume.
mapred.job.map.memory.mb set by user, per-job Job requirement for map tasks. The maximum amount of memory each map task of a job can consume, in MB.
mapred.job.reduce.memory.mb set by user, per-job job requirement for reduce tasks. The maximum amount of memory each reduce task of a job can consume, in MB.
mapred.cluster.max.map.memory.mb set by admin, cluster-wide Max limit on jobs. The maximum value that can be specified by a user via mapred.job.map.memory.mb, in MB. A job that asks for more than this number will be failed at submission itself.
mapred.cluster.max.reduce.memory.mb set by admin, cluster-wide Max limit on jobs. The maximum value that can be specified by a user via mapred.job.reduce.memory.mb, in MB. A job that asks for more than this number will be failed at submission itself.

不设置时默认都是-1,无限制

相关介绍请参考Hadoop-0.20.2 作业内存控制策略分析 http://www.linuxidc.com/Linux/2012-06/63310.htm

设置时请注意其大小关系。比如你设置了mapred.cluster.map.memory.mb为1024 ,然后你提交任务时没有设置mapred.job.map.memory.mb(默认为-1,无限制),此时便会报如下错误:

  1. 2012-06-13 16:18:10,951 ERROR exec.Task (SessionState.java:printError(380)) - Job Submission failed with exception 'org.apache.hadoop.ipc.RemoteException(java.io.IOException: job_201206131602_0003(-1 memForMapTasks -1 memForReduceTasks): Invalid job requirements.  
  2.         at org.apache.hadoop.mapred.JobTracker.checkMemoryRequirements(JobTracker.java:5160)  
  3.         at org.apache.hadoop.mapred.JobTracker.submitJob(JobTracker.java:3949)  
  4.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
  5.         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)  
  6.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)  
  7.         at java.lang.reflect.Method.invoke(Method.java:597)  
  8.         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:523)  
  9.         at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1383)  
  10.         at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1379)  
  11.         at java.security.AccessController.doPrivileged(Native Method)  
  12.         at javax.security.auth.Subject.doAs(Subject.java:396)  
  13.         at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1059)  
  14.         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1377)  
  15. )'  
  16. org.apache.hadoop.ipc.RemoteException: java.io.IOException: job_201206131602_0003(-1 memForMapTasks -1 memForReduceTasks): Invalid job requirements.  
  17.         at org.apache.hadoop.mapred.JobTracker.checkMemoryRequirements(JobTracker.java:5160)  
  18.         at org.apache.hadoop.mapred.JobTracker.submitJob(JobTracker.java:3949)  
  19.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
  20.         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)  
  21.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)  
  22.         at java.lang.reflect.Method.invoke(Method.java:597)  
  23.         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:523)  
  24.         at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1383)  
  25.         at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1379)  
  26.         at java.security.AccessController.doPrivileged(Native Method)  
  27.         at javax.security.auth.Subject.doAs(Subject.java:396)  
  28.         at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1059)  
  29.         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1377)  
  30.   
  31.         at org.apache.hadoop.ipc.Client.call(Client.java:1030)  
  32.         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:224)  
  33.         at org.apache.hadoop.mapred.$Proxy7.submitJob(Unknown Source)  
  34.         at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:862)  
  35.         at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:791)  
  36.         at java.security.AccessController.doPrivileged(Native Method)  
  37.         at javax.security.auth.Subject.doAs(Subject.java:396)  
  38.         at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1059)  
  39.         at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:791)  
  40.         at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:765)  
  41.         at org.apache.hadoop.hive.ql.exec.ExecDriver.execute(ExecDriver.java:452)  
  42.         at org.apache.hadoop.hive.ql.exec.MapRedTask.execute(MapRedTask.java:136)  
  43.         at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:133)  
  44.         at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:57)  
  45.         at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1332)  
  46.         at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1123)  
  47.         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:931)  
  48.         at org.apache.hadoop.hive.service.HiveServer$HiveServerHandler.execute(HiveServer.java:191)  
  49.         at org.apache.hadoop.hive.service.ThriftHive$Processor$execute.getResult(ThriftHive.java:629)  
  50.         at org.apache.hadoop.hive.service.ThriftHive$Processor$execute.getResult(ThriftHive.java:617)  
  51.         at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:32)  
  52.         at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34)  
  53.         at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:176)  
linux
相关资讯       Hadoop部署 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款