hive:tez如何增加am容器内存

vmdwslir  于 2021-06-24  发布在  Hive
关注(0)|答案(1)|浏览(483)

我正在尝试运行配置单元查询

set yarn.nodemanager.vmem-check-enabled=false;
set hive.strict.checks.cartesian.product=false;
select count(*)
from db1.tb1 a
where a.col1='2015-07-13'
and a.col2='val'
and exists (
         select 1 from db2.tb2 b
         where b.col1='2015-07-13'
           and b.col2='val'
           and size(a.col3)=size(b.col3));

但我一直在

Application application_1585768406438_10833 failed 2 times due to AM Container for appattempt_1585768406438_10833_000002 exited with  exitCode: -104
Failing this attempt.Diagnostics: [2020-04-26 19:47:06.497]Container [pid=30016,containerID=container_e03_1585768406438_10833_02_000001] is running beyond physical memory limits. Current usage: 1.0 GB of 1 GB physical memory used; 2.8 GB of 2.1 GB virtual memory used. Killing container.
Dump of the process-tree for container_e03_1585768406438_10833_02_000001 :s
--------|- PID PPID PGRPID SESSID CMD_NAME USER_MODE_TIME(MILLIS) SYSTEM_TIME(MILLIS) VMEM_USAGE(BYTES) RSSMEM_USAGE(PAGES) FULL_CMD_LINE
    |- 30101 30016 30016 30016 (java) 11364 769 3041062912 264859 /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Xmx819m -Djava.io.tmpdir=/hadoop/yarn/nm-local-dir/usercache/a0t00wf/appcache/application_1585768406438_10833/container_e03_1585768406438_10833_02_000001/tmp -server -Djava.net.preferIPv4Stack=true -Dhadoop.metrics.log.level=WARN -XX:+PrintGCDetails -verbose:gc -XX:+PrintGCTimeStamps -XX:+UseNUMA -XX:+UseParallelGC -Dlog4j.configuratorClass=org.apache.tez.common.TezLog4jConfigurator -Dlog4j.configuration=tez-container-log4j.properties -Dyarn.app.container.log.dir=/var/log/hadoop-yarn/userlogs/application_1585768406438_10833/container_e03_1585768406438_10833_02_000001 -Dtez.root.logger=INFO,CLA -Dsun.nio.ch.bugLevel= org.apache.tez.dag.app.DAGAppMaster --session

我试着用mapreduce而不是tez来运行这个程序,但是我面临同样的问题。我尝试了以下设置
泰兹

set tez.am.resource.memory.mb=4096
set tez.task.resource.memory.mb=4096
set tez.am.java.opts=-Xmx6144m;
set tez.am.resource.memory.mb=4096;
set hive.tez.container.size=4096;

先生

set hive.execution.engine=mr;
set mapreduce.map.memory.mb=4096;
set mapreduce.reduce.memory.mb=4096;
set mapreduce.map.java.opts=-Xmx6144m;
set mapreduce.reduce.java.opts=-Xmx6144m;

还有这些Yarn设置

set yarn.nodemanager.vmem-check-enabled=false;
set yarn.nodemanager.resource.memory-mb=98304;
set yarn.scheduler.minimum-allocation-mb=8192;
set yarn.scheduler.maximum-allocation-mb=98304;
set yarn.nodemanager.vmem-pmem-ratio=9;

但我总是犯同样的错误。如何增加am容器的内存限制?我怀疑问题是stacktrace中看到的java内存的一些限制 /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Xmx819m 是这样吗?如果是这样,我应该如何增加tez/hive使用的java内存?

zkure5ic

zkure5ic1#

首先,您需要了解堆是容器的一个子集。堆内存应该大约是容器内存的80%。

set hive.execution.engine=mr;  
set mapreduce.map.memory.mb=4096;  -- this is container memory
set mapreduce.reduce.memory.mb=4096;

下面的值是错误的。它们必须小于4096,否则您将始终获得超出内存限制的容器运行问题。

set mapreduce.map.java.opts=-Xmx6144m;  -- this is heap memory
set mapreduce.reduce.java.opts=-Xmx6144m;

而是将其设置为:

set mapreduce.map.java.opts=-Xmx3276m;   -- (80% of 4096)
set mapreduce.reduce.java.opts=-Xmx3276m;

下面是一篇关于理解这些术语的好文章:https://community.cloudera.com/t5/community-articles/demystify-apache-tez-memory-tuning-step-by-step/ta-p/245279

相关问题