Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check status of Spark applications from the command line?

Tags:

apache-spark

To check running applications in Apache spark, one can check them from the web interface on the URL:

http://<master>:8080

My question how we can check running applications from terminal, is there any command that returns applications status?

like image 558
Mohanad Kaleia Avatar asked May 24 '16 17:05

Mohanad Kaleia


People also ask

How do I run a Spark command?

Launch Spark Shell (spark-shell) CommandGo to the Apache Spark Installation directory from the command line and type bin/spark-shell and press enter, this launches Spark shell and gives you a scala prompt to interact with Spark in scala language.

Which command is used to check that Spark processes are running or not check running Spark JPS JPS?

$ jps -lm | grep -i spark 999 org.

How do I check my putty Spark?

Click on Admin -> Stack and Versions and you will find the version information under Version tab.


2 Answers

If it's for Spark Standalone or Apache Mesos cluster managers, @sb0709's answer is the way to follow.

For YARN, you should use yarn application command:

$ 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. 
like image 103
Jacek Laskowski Avatar answered Oct 09 '22 07:10

Jacek Laskowski


You can use spark-submit --status (as described in Mastering Apache Spark 2.0).

spark-submit --status [submission ID] 

See the code of spark-submit for reference:

if (!master.startsWith("spark://") && !master.startsWith("mesos://")) {   SparkSubmit.printErrorAndExit(     "Requesting submission statuses is only supported in standalone or Mesos mode!") } 
like image 43
n1tk Avatar answered Oct 09 '22 07:10

n1tk