Hive调优之运行Tez时检查到用过多内存而被NodeManager杀死进程

运行Tez时检查到用过多内存而被NodeManager杀死进程问题

(其中解决方案三和方案四在资深大数据工程师的建议下使用的,实测有效)

Caused by: org.apache.tez.dag.api.SessionNotRunning: TezSession has already shutdown. Application application_1546781144082_0005 failed 2 times due to AM Container for appattempt_1546781144082_0005_000002 exited with  exitCode: -103

For more detailed output, check application tracking page:http://hadoop103:8088/cluster/app/application_1546781144082_0005Then, click on links to logs of each attempt.

Diagnostics: Container [pid=11116,containerID=container_1546781144082_0005_02_000001] is running beyond virtual memory limits.

Current usage: 216.3 MB of 1 GB physical memory used; 2.6 GB of 2.1 GB virtual memory used. Killing container.

这种问题是从机上运行的Container试图使用过多的内存,而被NodeManager kill掉了。

[摘录] The NodeManager is killing your container. It sounds like you are trying to use hadoop streaming which is running as a child process of the map-reduce task.

The NodeManager monitors the entire process tree of the task and if it eats up more memory than the maximum set in mapreduce.map.memory.mb or mapreduce.reduce.memory.mb respectively,

we would expect the Nodemanager to kill the task, otherwise your task is stealing memory belonging to other containers, which you don't want.

 解决方法:

方案一:或者是关掉虚拟内存检查。我们选这个,修改yarn-site.xml,修改后一定要分发,并重新启动hadoop集群。

 

<property>

<name>yarn.nodemanager.vmem-check-enabled</name>

<value>false</value>

</property>

方案二:mapred-site.xml中设置Map和Reduce任务的内存配置如下:(value中实际配置的内存需要根据自己机器内存大小及应用情况进行修改) 

<property>

  <name>mapreduce.map.memory.mb</name>

  <value>1536</value>

</property>

<property>

  <name>mapreduce.map.java.opts</name>

  <value>-Xmx1024M</value>

</property>

<property>

  <name>mapreduce.reduce.memory.mb</name>

  <value>3072</value>

</property>

<property>

  <name>mapreduce.reduce.java.opts</name>

  <value>-Xmx2560M</value>

</property>

 方案三:设置yarn的虚拟内存(与操作系统中的虚拟内存概念上一致)和实际内存比例:

在hiveSQL语句前设置:

                     set yarn.nodemanager.vmem-pmem-ratio=5;(设置为5:1)

方案四:默认的执行引擎是Tez,可以设置使用mr:

在hiveSQL语句前设置:

                    set hive.execution.engine=mr;

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值