提交spark程式到yarn出現ERROR SparkContext: Error initializing SparkContext.
命令列輸出的java異常棧
ERROR SparkContext: Error initializing SparkContext.
org.apache.spark.SparkException: Yarn application has already ended! It might have been killed or unable to launch application master.at org.apache.spark.scheduler.cluster.YarnClientSchedulerBackend.waitForApplication(YarnClientSchedulerBackend.scala:85)
at org.apache.spark.scheduler.cluster.YarnClientSchedulerBackend.start(YarnClientSchedulerBackend.scala:62)
at org.apache.spark.scheduler.TaskSchedulerImpl.start(TaskSchedulerImpl.scala:173)
at org.apache.spark.SparkContext.<init>(SparkContext.scala:509)
at org.apache.spark.SparkContext$.getOrCreate(SparkContext.scala:2509)
at org.apache.spark.sql.SparkSession$Builder$$anonfun$6.apply(SparkSession.scala:909)
at org.apache.spark.sql.SparkSession$Builder$$anonfun$6.apply(SparkSession.scala:901)
at scala.Option.getOrElse(Option.scala:121)
at org.apache.spark.sql.SparkSession$Builder.getOrCreate(SparkSession.scala:901)
at com.rfzong.etl.myjob$.main(myjob.scala:6)
at com.rfzong.etl.myjob.main(myjob.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:755)
at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:180)
at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:205)
at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:119)
at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
18/02/25 19:24:49 WARN YarnSchedulerBackend$YarnSchedulerEndpoint: Attempted to request executors before the AM has registered!
18/02/25 19:24:49 WARN MetricsSystem: Stopping a MetricsSystem that is not running
Exception in thread "main" org.apache.spark.SparkException: Yarn application has already ended! It might have been killed or unable to launch application master.
at org.apache.spark.scheduler.cluster.YarnClientSchedulerBackend.waitForApplication(YarnClientSchedulerBackend.scala:85)
at org.apache.spark.scheduler.cluster.YarnClientSchedulerBackend.start(YarnClientSchedulerBackend.scala:62)
at org.apache.spark.scheduler.TaskSchedulerImpl.start(TaskSchedulerImpl.scala:173)
at org.apache.spark.SparkContext.<init>(SparkContext.scala:509)
ResourceManager日誌
WARN org.apache.hadoop.yarn.server.resourcemanager.RMAuditLogger: USER=shadow OPERATION=Application Finished - Failed TARGET=RMAppManager RESULT=FAILURE DESCRIPTION=App failed with state: FAILED PERMISSIONS=Application application_1519613501367_0002 failed 2 times due to AM Container for appattempt_1519613501367_0002_000002 exited with exitCode: 1
For more detailed output, check application tracking page:http://localdev:8088/proxy/application_1519613501367_0002/Then, click on links to logs of each attempt.
Diagnostics: Exception from container-launch.
Container id: container_1519613501367_0002_02_000001
Exit code: 1
Stack trace: ExitCodeException exitCode=1:
at org.apache.hadoop.util.Shell.runCommand(Shell.java:543)
at org.apache.hadoop.util.Shell.run(Shell.java:460)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:720)
at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:210)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:302)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:82)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Container exited with a non-zero exit code 1
錯誤原因:日誌上看是executor啟動失敗,出現這種問題的原因可能有很多。我的是因為spark中spark-env.sh配置的jdk和yarn中hadoop-env.sh配置的jdk版本不一致。
相關文章
- git提交出現error:YourlocalchangestothefollowingfileswouldbeoverwrittenbycheckoutGitError
- 有關error 46 encountered when initializing ldmError
- yarn add cross-env 出現 protocol error, symlink 解決方案YarnROSProtocolError
- 【Spark篇】---Spark中yarn模式兩種提交任務方式SparkYarn模式
- Spark —— Spark OOM Error問題排查定位SparkOOMError
- Spark on Yarn 任務提交流程原始碼分析SparkYarn原始碼
- error initializing graphdriver: devmapper: Base Device UUID and Filesystem verifErrordevAPPUI
- 登入Oracle錯誤提示Error 6 initializing SQL*PlusOracleErrorSQL
- zeppelin spark SparkContext問題 Cannot call methods on a stopped SparkContextSparkContext
- Spark-2.4.0原始碼:sparkContextSpark原始碼Context
- Spark 原始碼解析之SparkContextSpark原始碼Context
- Ubuntu git pull 出現Permission denied ErrorUbuntuGitError
- Spark on Yarn 和Spark on MesosSparkYarn
- Spark原始碼-SparkContext原始碼解析Spark原始碼Context
- 12 Spark on YARNSparkYarn
- hive on spark on yarnHiveSparkYarn
- Spark 原始碼系列(七)Spark on yarn 具體實現Spark原始碼Yarn
- 解決yarn打包時出現“FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory”的問題YarnErrorMITAIJavaScript
- android 打包出現錯誤Error: ResourceNameAndroidError
- 更改密碼時出現ERROR 1054密碼Error
- CocoaPods安裝出現SSL verification errorError
- MySQL斷電,出現 Error 1236MySqlError
- sloaris 出現“mount: I/O error”錯誤Error
- spark-submit提交到yarn中執行的log怎麼看?SparkMITYarn
- Spark on Yarn 實踐SparkYarn
- Spark:Yarn-client與Yarn-clusterSparkYarnclient
- ArchLinux出現ACPI ERROR的解決方法LinuxError
- sublime 出現 [Decode error - output not utf-8]Error
- openGauss 出現-Error-No-space-left-on-device-提示Errordev
- Docker中提交任務到Spark叢集DockerSpark
- spark 與 yarn 結合SparkYarn
- 搭建spark on yarn 叢集SparkYarn
- Spark on Yarn 環境搭建SparkYarn
- [iOS]提交App報錯ERROR ITMS -90207iOSAPPError
- linux CentOS出現Error: xz compression not availableLinuxCentOSErrorAI
- 解決 Jenkins 上 git 出現的 “ERROR: Error fetching remote repo 'origin'” 問題JenkinsGitErrorREM
- 執行專案出現Error: error:0308010C:digital envelope routines::unsupportedErrorGit
- git push origin master 時出現報錯 error: src refspec master does not match any error: failed to push someGitASTErrorAI