Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Apache Spark Spark Submit Standalone

From Leeroopedia


Field Value
Source Doc Spark Standalone
Domains Deployment
Type External Tool Doc
Related Principle:Apache_Spark_Standalone_Job_Submission

Overview

External tool documentation for submitting Spark applications to a standalone cluster via bin/spark-submit.

Description

bin/spark-submit with --master spark://host:port submits applications to the Spark standalone cluster. It supports two deploy modes:

  • Client mode (default) -- the driver runs on the machine where spark-submit is invoked
  • Cluster mode -- the master launches the driver on one of the worker nodes

In cluster mode, the --supervise flag enables automatic driver restart on failure, providing fault tolerance for long-running applications.

Usage

Use to submit applications to a running standalone cluster. The master URL in spark://host:port format is required. Choose the deploy mode based on the use case:

  • Client mode -- for interactive sessions, debugging, and short-lived jobs
  • Cluster mode -- for production workloads where the driver should survive client disconnection

Code Reference

Source: docs/submitting-applications.md (L60-175)

Command:

bin/spark-submit --master spark://<host>:<port> [options] <app-jar> [app-args]

Key options:

Option Description
--master spark://host:port Required. The master URL for the standalone cluster.
cluster Where to run the driver (default: client).
--class main-class The main class of the application.
--supervise Restart the driver on failure (cluster mode only).

I/O

Direction Description
Inputs --master spark://host:port (required), --deploy-mode client or cluster, --class main-class, application JAR, app arguments
Outputs Application execution results, driver output

Examples

Client mode submission:

./bin/spark-submit \
  --master spark://master:7077 \
  --class com.example.App \
  app.jar

Cluster mode submission:

./bin/spark-submit \
  --master spark://master:7077 \
  --deploy-mode cluster \
  --class com.example.App \
  app.jar

Cluster mode with supervise (auto-restart on failure):

./bin/spark-submit \
  --master spark://master:7077 \
  --deploy-mode cluster \
  --supervise \
  --class com.example.App \
  app.jar

Related

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment