当前位置:Gxlcms > 数据库问题 > spark sql运行出错(Container killed on request. Exit code is 143)

spark sql运行出错(Container killed on request. Exit code is 143)

时间:2021-07-01 10:21:17 帮助过:7人阅读

mapreduce.map.memory.mb; mapreduce.map.memory.mb=4096 hive (default)> SET mapreduce.reduce.memory.mb; mapreduce.reduce.memory.mb=4096 hive (default)> SET yarn.nodemanager.vmem-pmem-ratio; yarn.nodemanager.vmem-pmem-ratio=4.2

因此,单个map和reduce分配物理内存4G;虚拟内存限制4*4.2=16.8G;

单个reduce处理数据量超过内存4G的限制导致;设置 mapreduce.reduce.memory.mb=8192 解决;

参考:

http://stackoverflow.com/questions/29001702/why-yarn-java-heap-space-memory-error?answertab=oldest#tab-top

There are memory settings that can be set at the Yarn container level and also at the mapper and reducer level. Memory is requested in increments of the Yarn container size. Mapper and reducer tasks run inside a container.

mapreduce.map.memory.mb and mapreduce.reduce.memory.mb

above parameters describe upper memory limit for the map-reduce task and if memory subscribed by this task exceeds this limit, the corresponding container will be killed.

These parameters determine the maximum amount of memory that can be assigned to mapper and reduce tasks respectively. Let us look at an example: Mapper is bound by an upper limit for memory which is defined in the configuration parameter mapreduce.map.memory.mb.

However, if the value for yarn.scheduler.minimum-allocation-mb is greater than this value of mapreduce.map.memory.mb, then the yarn.scheduler.minimum-allocation-mb is respected and the containers of that size are given out.

This parameter needs to be set carefully and if not set properly, this could lead to bad performance or OutOfMemory errors.

mapreduce.reduce.java.opts and mapreduce.map.java.opts

This property value needs to be less than the upper bound for map/reduce task as defined in mapreduce.map.memory.mb/mapreduce.reduce.memory.mb, as it should fit within the memory allocation for the map/reduce task.

HOW TO PLAN AND CONFIGURE YARN AND MAPREDUCE 2 IN HDP 2.0

spark sql运行出错(Container killed on request. Exit code is 143)

标签:

人气教程排行