Container killed on request. Exit code is 143

求知探索 1年前 ⋅ 747 阅读

mapreduce运行中发现有任务被kill掉,多半是因为内存分配不足造成,所有需要修改内存配置。

首先在yarn-site.xml中添加下面内容:

<property>
    <name>yarn.nodemanager.resource.memory-mb</name>
    <value>22528</value>
    <discription>每个节点可用内存,单位MB</discription>
</property>
 
<property>
    <name>yarn.scheduler.minimum-allocation-mb</name>
    <value>1500</value>
    <discription>单个任务可申请最少内存,默认1024MB</discription>
</property>
 
<property>
    <name>yarn.scheduler.maximum-allocation-mb</name>
    <value>16384</value>
    <discription>单个任务可申请最大内存,默认8192MB</discription>
</property>
  • 然后在mapred-site.xml中添加下面内容:
<property>
    <name>mapreduce.map.memory.mb</name>
    <value>1500</value>
    <description>每个Map任务的物理内存限制</description>
</property>
 
<property>
    <name>mapreduce.reduce.memory.mb</name>
    <value>3000</value>
    <description>每个Reduce任务的物理内存限制</description>
</property>
 
<property>
    <name>mapreduce.map.java.opts</name>
    <value>-Xmx1200m</value>
</property>
 
<property>
    <name>mapreduce.reduce.java.opts</name>
    <value>-Xmx2600m</value>
</property>
<property>
    <name>mapreduce.framework.name</name>
    <value>yarn</value>
</property>

重启yarn再启动mapreduce任务,就可以了


全部评论: 0

    我有话说: