提交后如何退出spark-submit
How to exit spark-submit after the submission
使用spark-submit提交spark流程序时(YARN模式)
它不断轮询状态并且永远不会退出
spark-submit中有没有提交后退出的选项?
===为什么这么麻烦我===
流式传输程序将永远 运行,我不需要状态更新
如果我手动启动它,我可以ctrl+c停止它
但是我有很多流上下文要启动,我需要使用脚本启动它们
我可以把spark-submit程序放在后台,
但是在创建了大量后台 java 进程后,对应的用户将无法 运行 任何其他 java 进程,因为 JVM 无法创建 GC 线程
有意思。我从来没有想过这个问题。不确定是否有一种干净的方法可以做到这一点,但我只是简单地终止了机器上的提交进程,并且 yarn 作业继续 运行 直到你明确停止它。因此,您可以创建一个脚本来执行 spark 提交,然后将其终止。当你真的想停止工作时使用 yarn -kill。脏但有效。
命令timeout TIME CMD
将在TIME
后关闭CMD
我知道这是一个老问题,但现在有一种方法可以通过在使用 spark-submit
时设置 --conf spark.yarn.submit.waitAppCompletion=false
来解决这个问题。这样客户端在提交申请成功后就会退出
In YARN cluster mode, controls whether the client waits to exit until
the application completes. If set to true, the client process will
stay alive reporting the application's status. Otherwise, the client
process will exit after submission.
此外,您可能需要将 --deploy-mode
设置为 cluster
In cluster mode, the Spark driver runs inside an application master
process which is managed by YARN on the cluster, and the client can go
away after initiating the application.
更多内容在 https://spark.apache.org/docs/latest/running-on-yarn.html
使用spark-submit提交spark流程序时(YARN模式) 它不断轮询状态并且永远不会退出
spark-submit中有没有提交后退出的选项?
===为什么这么麻烦我===
流式传输程序将永远 运行,我不需要状态更新
如果我手动启动它,我可以ctrl+c停止它 但是我有很多流上下文要启动,我需要使用脚本启动它们
我可以把spark-submit程序放在后台, 但是在创建了大量后台 java 进程后,对应的用户将无法 运行 任何其他 java 进程,因为 JVM 无法创建 GC 线程
有意思。我从来没有想过这个问题。不确定是否有一种干净的方法可以做到这一点,但我只是简单地终止了机器上的提交进程,并且 yarn 作业继续 运行 直到你明确停止它。因此,您可以创建一个脚本来执行 spark 提交,然后将其终止。当你真的想停止工作时使用 yarn -kill。脏但有效。
命令timeout TIME CMD
将在TIME
我知道这是一个老问题,但现在有一种方法可以通过在使用 spark-submit
时设置 --conf spark.yarn.submit.waitAppCompletion=false
来解决这个问题。这样客户端在提交申请成功后就会退出
In YARN cluster mode, controls whether the client waits to exit until the application completes. If set to true, the client process will stay alive reporting the application's status. Otherwise, the client process will exit after submission.
此外,您可能需要将 --deploy-mode
设置为 cluster
In cluster mode, the Spark driver runs inside an application master process which is managed by YARN on the cluster, and the client can go away after initiating the application.
更多内容在 https://spark.apache.org/docs/latest/running-on-yarn.html