Skip to main content
 首页 » 编程设计

apache-spark之如何从命令行检查 Spark 应用程序的状态

2025年02月15日26tintown

要检查 Apache Spark 中正在运行的应用程序,可以从 URL 上的 Web 界面检查它们:
http://<master>:8080
我的问题是如何从终端检查正在运行的应用程序,是否有任何返回应用程序状态的命令?

请您参考如下方法:

如果是用于 Spark Standalone 或 Apache Mesos 集群管理器,@sb0709's answer是遵循的方式。

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

$ 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.