3

I've been running some hive scripts on an aws emr 4.8 cluster with hive 1.0 and tez 0.8.

My configurations look like this:

SET hive.exec.compress.output=true;
SET mapred.output.compression.type=BLOCK;
SET hive.exec.dynamic.partition = true;
SET hive.exec.dynamic.partition.mode = nonstrict;
set hive.execution.engine=tez;
set hive.merge.mapfiles=false;
SET hive.default.fileformat=Orc;
set tez.task.resource.memory.mb=5000;
SET hive.tez.container.size=6656;
SET hive.tez.java.opts=-Xmx5120m;
set hive.optimize.ppd=true;

And my global configs are:

hadoop-env.export   HADOOP_HEAPSIZE 4750
hadoop-env.export   HADOOP_DATANODE_HEAPSIZE    4750
hive-env.export HADOOP_HEAPSIZE 4750

While running my script, I get the following error:

Container [pid=19027,containerID=container_1477393351192_0007_02_000001] is running beyond physical memory limits. Current usage: 1.0 GB of 1 GB physical memory used; 1.9 GB of 5 GB virtual memory used. Killing container.

On googling this error, I read that set tez.task.resource.memory.mb will change the physical memory limit, but clearly I was mistaken. What am I missing?

4

4 回答 4

5

我经常遇到这个问题。变化的

Set hive.tez.container.size=6656;
Set hive.tez.java.opts=-Xmx4g;

不能为我解决问题,但这确实:

set tez.am.resource.memory.mb=4096;
于 2019-08-09T14:57:33.903 回答
2

将 Tez 容器大小设置为 YARN 容器大小 (4GB) 的更大倍数:

SET hive.tez.container.size=4096MB

“hive.tez.container.size”和“hive.tez.java.opts”是改变 Hive 中 Tez 内存设置的参数。如果“hive.tez.container.size”设置为“-1”(默认值),它会选择“mapreduce.map.memory.mb”的值。如果未指定“hive.tez.java.opts”,则它依赖于“mapreduce.map.java.opts”设置。因此,如果将 Tez 特定的内存设置保留为默认值,则从 mapreduce 映射器内存设置“mapreduce.map.memory.mb”中选择内存大小。

https://documentation.altiscale.com/memory-settings-for-tez

有关更多信息Tez 配置Tez 内存调整

注意:使用 Ambari 以 MB 为单位设置

于 2016-10-26T04:19:57.773 回答
1

万一其他人偶然发现这个线程试图解决上面的问题,这里有一个链接到一个真正的解决方案,它对我有用,而所有其他解决方案都没有。

http://moi.vonos.net/bigdata/hive-cli-memory/

TL;DR 将这些添加到您的配置单元调用中--hiveconf tez.am.resource.memory.mb=<size as int> --hiveconf tez.am.launch.cmd-opts=""

于 2020-02-11T20:42:40.520 回答
0
Set hive.tez.container.size=6656
Set hive.tez.java.opts=-Xmx4g
于 2016-10-26T02:07:48.683 回答