spark Container killed on request. Exit code is 143 解决办法

栏目: 编程工具 · 发布时间: 4年前

内容简介:scala启动多个sparkcontext时,发现启动不起来。查看Applications任务时,发现Memory Total和Memory Used一样了。For more detailed output, check application tracking page:http://bigserver1:8088/cluster/app/application_1555651019351_0001Then, click on links to logs of each attempt.Diagnosti

scala启动多个sparkcontext时,发现启动不起来。查看Applications任务时,发现Memory Total和Memory Used一样了。

一,调整spark,driver和executor的内存

1,log日志错误

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

Diagnostics: Container [pid=280568,containerID=container_e09_1555651019351_0001_02_000001] is running beyond virtual memory limits. Current usage: 383.9 MB of 1 GB physical memory used; 1.5 GB of 1.1 GB virtual memory used. Killing container.

Killed by external signal

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。省略。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

Container killed on request. Exit code is 143

Container exited with a non-zero exit code 143

Failing this attempt

2,java异常错误

2019-04-24 14:42:31 ERROR TransportRequestHandler:293 - Error sending result RpcResponse{requestId=8586978943123146370, body=NioManagedBuffer{buf=java.nio.HeapByteBuffer[pos=0 lim=13 cap=13]}} to /10.0.40.222:34982; closing connection

io.netty.handler.codec.EncoderException: java.lang.OutOfMemoryError: Java heap space

上面二个错误,都是因为spark分配的内存不足造成的,解决办法有二种

1,spark-submit的时候加上--driver-memory 2g --executor-memory 2g

2,修改spark-defaults.conf,添加以下内容

spark.driver.memory              2g
spark.executor.memory            2g

第二方法,改完后要重启spark集群。

改过后,spark-submit不报错,跑完后,出现以下内容说明配置成功

spark Container killed on request. Exit code is 143 解决办法

spark driver executor 内存调整

二,调整yarn资源

SparkContext.java.lang.IllegalArgumentException: Required executor memory (1024+384 MB) is above the max threshold (1024 MB) of this cluster! Please check the values of 'yarn.scheduler.maximum-allocation-mb' and/or 'yarn.nodemanager.resource.memory-mb'.

解决办法:修改yarn-site.xml

<property>
 <name>yarn.nodemanager.resource.cpu-vcores</name>
 <value>16</value>
</property>
<property>
 <name>yarn.scheduler.minimum-allocation-vcores</name>
 <value>1</value>
</property>
<property>
 <name>yarn.scheduler.maximum-allocation-vcores</name>
 <value>16</value>
</property>

<property>
 <name>yarn.nodemanager.resource.memory-mb</name>
 <value>16384</value>
</property>
<property>
 <name>yarn.scheduler.minimum-allocation-mb</name>
 <value>1024</value>
</property>
<property>
 <name>yarn.scheduler.maximum-allocation-mb</name>
 <value>16384</value>
</property>

改过的文件同步到hadoop集群中的所有机器上面,然后重启hadoop集群,如果Memory Total,增加了,说明成功了。

spark Container killed on request. Exit code is 143 解决办法

yarn 内存调整


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

C++程序设计

C++程序设计

谭浩强 / 清华大学出版社 / 2004-6-1 / 36.00元

《C++程序设计》作者深入调查了我国大学的程序设计课程的现状和发展趋势,参阅了国内外数十种有关C++的教材,认真分析了学习者在学习过程中遇到的困难,研究了初学者的认识规律。在本书中做到准确定位,合理取舍内容,设计了读者易于学习的教材体系,并且以通俗易懂的语言化解了许多复杂的概念,大大减少了初学者学习C++的困难。C++是近年来国内外广泛使用的现代计算机语言,它既支持面向过程的程序设计,也支持基于对......一起来看看 《C++程序设计》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

SHA 加密
SHA 加密

SHA 加密工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具