如何从命令行检查Spark应用程序的状态?

Moh*_*eia 21 apache-spark

要检查Apache spark中正在运行的应用程序,可以从URL上的Web界面检查它们:

http://<master>:8080

我的问题是如何从终端检查运行的应用程序,是否有任何返回应用程序状态的命令?

Jac*_*ski 11

如果它适用于Spark Standalone或Apache Mesos集群管理器,@ sb0709的答案是可以遵循的方法.

对于YARN,您应该使用yarn应用程序命令:

$ yarn application -help
usage: application
 -appStates <States>             Works with -list to filter applications
                                 based on input comma-separated list of
                                 application states. The valid application
                                 state can be one of the following:
                                 ALL,NEW,NEW_SAVING,SUBMITTED,ACCEPTED,RUN
                                 NING,FINISHED,FAILED,KILLED
 -appTypes <Types>               Works with -list to filter applications
                                 based on input comma-separated list of
                                 application types.
 -help                           Displays help for all commands.
 -kill <Application ID>          Kills the application.
 -list                           List applications. Supports optional use
                                 of -appTypes to filter applications based
                                 on application type, and -appStates to
                                 filter applications based on application
                                 state.
 -movetoqueue <Application ID>   Moves the application to a different
                                 queue.
 -queue <Queue Name>             Works with the movetoqueue command to
                                 specify which queue to move an
                                 application to.
 -status <Application ID>        Prints the status of the application.
Run Code Online (Sandbox Code Playgroud)


n1t*_*1tk 5

您可以使用spark-submit --status(如掌握Apache Spark 2.0中所述).

spark-submit --status [submission ID]
Run Code Online (Sandbox Code Playgroud)

请参阅spark-submit代码以供参考:

if (!master.startsWith("spark://") && !master.startsWith("mesos://")) {
  SparkSubmit.printErrorAndExit(
    "Requesting submission statuses is only supported in standalone or Mesos mode!")
}
Run Code Online (Sandbox Code Playgroud)

  • 如何从命令行查找提交ID? (30认同)
  • 请注意(根据链接)`--status` 选项仅适用于具有集群部署模式(而不是 YARN)的 Spark 独立或 Mesos (2认同)