簡體   English   中英

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

[英]When does a Spark on YARN application exit with exitCode: -104?

我的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 

請查看我的驅動程序節點中運行的容器

在此輸入圖像描述

為什么在一個節點中運行許多容器。 我知道container_e98_1521733534016_7880_02_000001適用於我的spark應用程序。 我不知道其他容器? 有什么想法嗎? 另外我看到container_e98_1521733534016_7880_02_000001的物理內存是3584,接近3.5 GB

這個錯誤是什么意思? 它通常會發生嗎?

什么是3.5 GB的3.5 GB物理內存? 是司機記憶嗎?

有人可以幫我解決這個問題嗎?

@Jacek已經寫過來回答問題的一小部分內容

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

除了DRIVER_MEMORY=3G你需要考慮spark.driver.memoryOverhead ,可以計算為MIN(DRIVER_MEMORY * 0.10,384)MB = 384MB + 3GB~3.5GB

container_e98_1521733534016_7233_02_000001是第一個啟動的容器,並且給出了MASTER_URL=yarn-cluster ,它不僅是ApplicationMaster,還是Spark應用程序的驅動程序。

看起來驅動程序的內存設置,即DRIVER_MEMORY=3G ,太低了,你必須將其提升。

默認情況下,YARN上的Spark會運行兩個執行程序(請參閱--num-executors ),因此最終會有3個YARN容器,其中000001用於ApplicationMaster(可能帶有驅動程序), 000002000003用於兩個執行程序。

什么是3.5 GB的3.5 GB物理內存? 是司機記憶嗎?

由於您使用yarn-cluster驅動程序,因此ApplicationMaster和container_e98_1521733534016_7233_02_000001都是相同的,並且位於同一個JVM中。 這給出了錯誤是關於您為驅動程序分配了多少內存。

我的理解是你提供了DRIVER_MEMORY=3G ,它碰巧對你的處理來說太少了,而且一旦YARN認為它殺了驅動程序(因此殺死了整個Spark應用程序,因為沒有驅動程序就無法啟動和運行Spark應用程序)。

請參閱YARN上的Running Spark文檔。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM