spark Yarn mode how to get applicationId from spark-submit

那年仲夏 提交于 2019-12-08 02:04:25

问题


When I submit spark job using spark-submit with master yarn and deploy-mode cluster, it doesn't print/return any applicationId and once job is completed I have to manually check MapReduce jobHistory or spark HistoryServer to get the job details.
My cluster is used by many users and it takes lot of time to spot my job in jobHistory/HistoryServer.

is there any way to configure spark-submit to return the applicationId?

Note: I found many similar questions but their solutions retrieve applicationId within the driver code using sparkcontext.applicationId and in case of master yarn and deploy-mode cluster the driver also run as a part of mapreduce job, any logs or sysout printed to remote host log.


回答1:


Here are the approaches that I used to achieve this:

  1. Save the application Id to HDFS file. (Suggested by @zhangtong in comment).
  2. Send an email alert with applictionId from driver.


来源:https://stackoverflow.com/questions/44209462/spark-yarn-mode-how-to-get-applicationid-from-spark-submit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!