yarn下的mapreduce内存问题

参考

ERROR:is running beyond physical memory limits.
Tuning yarn
Yarn下Mapreduce的内存参数理解
Yarn下Mapreduce的内存参数理解&xml参数配置

前因

使用Hadoop的streming.jar遇到问题

问题1:

18/10/13 19:40:56 INFO input.FileInputFormat: Total input files to process : 701930
18/10/13 20:04:22 INFO retry.RetryInvocationHandler: java.io.IOException: com.google.protobuf.ServiceException: java.lang.OutOfMemoryError: GC overhead limit exceeded, while invoking ClientNamenodeProtocolTranslatorPB.getBlockLocations over 2.master.mz/192.168.10.224:8020. Trying to failover immediately.

18/10/13 20:05:04 INFO mapreduce.JobSubmitter: Cleaning up the staging area /user/admonitor/.staging/job_1539157945372_30633
Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded
        at java.lang.String.substring(String.java:1933)
        at java.util.Formatter.parse(Formatter.java:2567)
        at java.util.Formatter.format(Formatter.java:2501)
        at java.util.Formatter.format(Formatter.java:2455)
        at java.lang.String.format(String.java:2940)
        at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:471)
        at org.apache.hadoop.fs.Path.getFileSystem(Path.java:361)

outofmemory,GC,读取大量小文件getBlockLocations时出错
添加参数HADOOP_CLIENT_OPTS,该选项增加的参数,将会作用于多个命令,如fs, dfs, fsck, distcp等

HADOOP_CLIENT_OPTS="-Xmx8192M" hadoop jar $stream_jar ...

问题2:

Container [pid=100823,containerID=container_e39_1539157945372_36692_01_000527] is running 108359680B beyond the 'PHYSICAL' memory limit. Current usage: 1.1 GB of 1 GB physical memory used; 3.1 GB of 2.1 GB virtual memory used. Killing container.

物理内存和虚拟内存不足
添加内存,需要注意的是需要判断是map还是reduce过程出现的内存不足

  -Dmapreduce.map.memory.mb=8192 \
  -Dmapreduce.map.java.opts=-Xmx7168M \
  -Dmapreduce.reduce.memory.mb=4096 \
  -Dmapreduce.reduce.java.opts=-Xmx3072M \

关于yarn下的内存参数配置

参数描述

name默认值描述
yarn.nodemanager.resource.memory-mb8GBAmount of physical memory, in MB, that can be allocated for containers. If set to -1 and yarn.nodemanager.resource.detect-hardware-capabilities is true, it is automatically calculated(in case of Windows and Linux). In other cases, the default is 8192MB.
yarn.nodemanager.vmem-pmem-ratio2.1虚拟内存率,是占task所用内存的百分比,默认值为2.1倍。
yarn.scheduler.minimum-allocation-mb1G单个container可申请的最小与最大内存
yarn.scheduler.maximum-allocation-mb8G
mapreduce.map.memory.mb设置container大小
mapreduce.reduce.memory.mb
mapreduce.map.java.opts设置container启动jvm相关参数,比memory.mb小,一般设置为0.75倍的memory.mb
mapreduce.reduce.java.opts
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值