什么时候在YARN应用程序上使用exitCode:-104退出?

时间:2018-03-28 11:22:44

标签: apache-spark apache-spark-sql yarn

我的spark应用程序读取3个7 MB,40 MB,100 MB的文件以及如此多的转换并存储多个目录

Spark版本CDH1.5

MASTER_URL=yarn-cluster
NUM_EXECUTORS=15
EXECUTOR_MEMORY=4G
EXECUTOR_CORES=6
DRIVER_MEMORY=3G

我的火花作业已运行一段时间然后它抛出以下错误消息并从开始重新启动

18/03/27 18:59:44 INFO avro.AvroRelation: using snappy for Avro output
18/03/27 18:59:47 ERROR yarn.ApplicationMaster: RECEIVED SIGNAL 15: SIGTERM
18/03/27 18:59:47 INFO CuratorFrameworkSingleton: Closing ZooKeeper client.

再次重新启动它会运行一段时间并因此错误而失败

Application application_1521733534016_7233 failed 2 times due to AM Container for appattempt_1521733534016_7233_000002 exited with exitCode: -104
For more detailed output, check application tracking page:http://entline.com:8088/proxy/application_1521733534016_7233/Then, click on links to logs of each attempt.
Diagnostics: Container [pid=52716,containerID=container_e98_1521733534016_7233_02_000001] is running beyond physical memory limits. Current usage: 3.5 GB of 3.5 GB physical memory used; 4.3 GB of 7.3 GB virtual memory used. Killing container.
Dump of the process-tree for container_e98_1521733534016_7233_02_000001 :
|- PID PPID PGRPID SESSID CMD_NAME USER_MODE_TIME(MILLIS) SYSTEM_TIME(MILLIS) VMEM_USAGE(BYTES) RSSMEM_USAGE(PAGES) FULL_CMD_LINE
|- 52720 52716 52716 52716 (java) 89736 8182 4495249408 923677 /usr/java/jdk1.7.0_67-cloudera/bin/java -server -Xmx3072m -Djava.io.tmpdir=/apps/hadoop/data04/yarn/nm/usercache/bdbuild/appcache/application_1521733534016_7233/container_e98_1521733534016_7233_02_000001/tmp -Dspark.yarn.app.container.log.dir=/var/log/hadoop-yarn/container/application_1521733534016_7233/container_e98_1521733534016_7233_02_000001 -XX:MaxPermSize=256m org.apache.spark.deploy.yarn.ApplicationMaster --class com.sky.ids.dovetail.asrun.etl.DovetailAsRunETLMain --jar file:/apps/projects/dovetail_asrun_etl/jars/EntLine-1.0-SNAPSHOT-jar-with-dependencies.jar --arg --app.conf.path --arg application.conf --arg --run_type --arg AUTO --arg --bus_date --arg 2018-03-27 --arg --code_base_id --arg EntLine-1.0-SNAPSHOT --executor-memory 4096m --executor-cores 6 --properties-file /apps/hadoop/data04/yarn/nm/usercache/bdbuild/appcache/application_1521733534016_7233/container_e98_1521733534016_7233_02_000001/__spark_conf__/__spark_conf__.properties
|- 52716 52714 52716 52716 (bash) 2 0 108998656 389 /bin/bash -c LD_LIBRARY_PATH=/opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hadoop/../../../CDH-5.5.1-1.cdh5.5.1.p0.11/lib/hadoop/lib/native: /usr/java/jdk1.7.0_67-cloudera/bin/java -server -Xmx3072m -Djava.io.tmpdir=/apps/hadoop/data04/yarn/nm/usercache/bdbuild/appcache/application_1521733534016_7233/container_e98_1521733534016_7233_02_000001/tmp -Dspark.yarn.app.container.log.dir=/var/log/hadoop-yarn/container/application_1521733534016_7233/container_e98_1521733534016_7233_02_000001 -XX:MaxPermSize=256m org.apache.spark.deploy.yarn.ApplicationMaster --class 'com.sky.ids.dovetail.asrun.etl.DovetailAsRunETLMain' --jar file:/apps/projects/dovetail_asrun_etl/jars/EntLine-1.0-SNAPSHOT-jar-with-dependencies.jar --arg '--app.conf.path' --arg 'application.conf' --arg '--run_type' --arg 'AUTO' --arg '--bus_date' --arg '2018-03-27' --arg '--code_base_id' --arg 'EntLine-1.0-SNAPSHOT' --executor-memory 4096m --executor-cores 6 --properties-file /apps/hadoop/data04/yarn/nm/usercache/bdbuild/appcache/application_1521733534016_7233/container_e98_1521733534016_7233_02_000001/__spark_conf__/__spark_conf__.properties 1> /var/log/hadoop-yarn/container/application_1521733534016_7233/container_e98_1521733534016_7233_02_000001/stdout 2> /var/log/hadoop-yarn/container/application_1521733534016_7233/container_e98_1521733534016_7233_02_000001/stderr
Container killed on request. Exit code is 143
Container exited with a non-zero exit code 143
Failing this attempt. Failing the application.

根据我的CDH

 Container Memory[Amount of physical memory, in MiB, that can be allocated for containers]

 yarn.nodemanager.resource.memory-mb   50655 MiB 

请参阅我的驱动程序节点中运行的容器

enter image description here

为什么有多个容器在一个节点中运行。  我知道container_e98_1521733534016_7880_02_000001适用于我的spark应用程序。我不知道其他容器?有什么想法吗? 另外我看到container_e98_1521733534016_7880_02_000001的物理内存是3584,接近3.5 GB

这个错误是什么意思?它通常会发生吗?

什么是3.5 GB的3.5 GB物理内存?是司机记忆吗?

有人可以帮我解决这个问题吗?

2 个答案:

答案 0 :(得分:3)

@Jacek已经写过的回答问题的一小部分

  

为什么你得到3.5GB而不是3GB?

DRIVER_MEMORY=3G除了需要考虑的spark.driver.memoryOverhead,可以计算为MIN(DRIVER_MEMORY * 0.10,384)MB = 384MB + 3GB~3.5GB

答案 1 :(得分:2)

HTML: <input type="checkbox" class="custom-control-input" [(ngModel)]="checkboxvalue" name="iscanRetrunable" checked> `, }) Component: export class App { checkboxvalue = true; constructor() { } } 是第一个启动并被赋予container_e98_1521733534016_7233_02_000001的容器,它不仅是ApplicationMaster,还是Spark应用程序的驱动程序。

驱动程序的内存设置(即MASTER_URL=yarn-cluster)似乎太低,您必须将其提升。

默认情况下,YARN上的Spark会运行两个执行程序(请参阅DRIVER_MEMORY=3G),因此最终会为ApplicationMaster(可能带有驱动程序)和{{1}结束3个带有{​​{1}}的YARN容器和--num-executors两个执行者。

  

什么是3.5 GB的3.5 GB物理内存?是司机记忆吗?

由于您使用000001驱动程序,因此ApplicationMaster和000002都是相同的并且存在于同一个JVM中。这就是错误是关于你为驱动程序分配了多少内存。

我的理解是你提供的000003碰巧对你的处理来说太少了,而且一旦YARN认为它杀了驱动程序(因此杀死了整个Spark应用程序,因为它不可能有一个Spark应用程序并在没有司机的情况下运行。)

请参阅文档Running Spark on YARN