我正在尝试将配置单元查询作为运行
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来运行这个,但我遇到了同样的问题。我尝试了以下设置
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;
以及这些纱线设置
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容器的内存限制?我怀疑这个问题是堆叠中看到的java内存的一些限制
/usr/lib/jvm/java-8-openjdk-amd64/bin/java -Xmx819m
是这样吗?如果是,我应该如何增加tez/hive使用的java内存?
首先,您需要了解堆是容器的一个子集。堆内存应该大约是容器内存的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