# Start Spark

\=======

## sbin/start-master.sh

bin/start-master.sh --> bin/spark-daemon.sh --> bin/spark-class org.apache.spark.deploy.master.Master

## bin/spark-shell

bin/spark-shell --> bin/spark-submit --class org.apache.spark.repl.Main --name "Spark shell" --> bin/spark-class org.apache.spark.deploy.SparkSubmit --class org.apache.spark.repl.Main --name "Spark shell" --> java org.apache.spark.launcher.Main org.apache.spark.deploy.SparkSubmit --class org.apache.spark.repl.Main --name "Spark shell"

## bin/spark-submit

bin/spark-submit --> bin/spark-class org.apache.spark.deploy.SparkSubmit --> java org.apache.spark.launcher.Main

* SparkClassCommandBuilder
* SparkSubmitCommandBuilder

org.apache.spark.launcher.Main build the commands to run and then exit the process. spark-class will use the commands to launch another process using the commands

```
done < <("$RUNNER" -cp "$LAUNCH_CLASSPATH" org.apache.spark.launcher.Main "$@")
exec "${CMD[@]}
```

## Tips for how to get the launcher details

* export SPARK\_PRINT\_LAUNCH\_COMMAND=true
* bin/spark-shell --verbose


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zjffdu.gitbook.io/spark-notes/chapter1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
