Apache Mesos support in Spark
| Also known as | Spark on Mesos, Mesos cluster manager |
|---|---|
| Field | Cluster resource management |
| Introduced | Before Spark 1.0; Spark was first built on Mesos |
| Key parts | mesos:// master URLs, coarse-grained and fine-grained modes, MesosClusterDispatcher
|
| Open source implementations | Apache Spark 3.5 and earlier |
| Related | Executor, Spark on Kubernetes, Spark on YARN, Spark 3 to Spark 4 migration |
Apache Mesos support in Spark was the integration that let Apache Spark use Apache Mesos as its cluster manager: a Spark application pointed at a mesos:// master URL received resources from Mesos and ran its executors as Mesos tasks.[2] Spark itself was first written as a Mesos framework. Spark deprecated Mesos support in 3.2.0 and removed it in 4.0.0, so Spark 3.5 is the last release line that can run on Mesos.[3][1]
Status
Mesos support was deprecated in one minor release and removed in the next major release.
- Deprecated in Spark 3.2.0. SPARK-35050, "Deprecate Apache Mesos as resource manager", has fix version 3.2.0. Its description gives the reason: a thread on the Mesos dev list said that Mesos was moving to the Apache Attic and ceasing development.[4] From 3.2.0 the Mesos page of the Spark documentation opens with the note that Mesos support "is deprecated as of Apache Spark 3.2.0" and "will be removed in a future version", and the core migration guide says the same.[2][3]
- Removed in Spark 4.0.0. SPARK-44442, "Drop mesos support", has fix version 4.0.0. The
resource-managers/mesosmodule is present at the v3.5.0 tag and absent at the v4.0.0 tag. The Spark 4.0.0 core migration guide states: "In Spark 4.0, support for Apache Mesos as a resource manager was removed."[1][3] The 4.0.0 release notes list SPARK-44442 and show themesoslibrary dependency (1.4.3) as removed.[5] - Fine-grained mode was deprecated earlier, in Spark 2.0.0, as the Mesos documentation noted until support ended.[6]
The Mesos project itself is also gone. The ASF board approved a resolution to terminate the Apache Mesos project on 20 August 2025, and the Apache Attic records that Mesos retired in August 2025 and that its move to the Attic was completed in October 2025.[7][8]
History
Spark began at UC Berkeley as an application of Mesos. The 2010 HotCloud paper that introduced Spark says that "Spark is built on top of Mesos", a "cluster operating system" that lets several parallel applications share a cluster, and that building on Mesos reduced the programming effort Spark needed.[9] Spark later supported other cluster managers as well (its own standalone manager, Hadoop YARN and Kubernetes), and Mesos became one option among several.
When the Mesos community discussed moving the project to the Attic, Spark deprecated its integration (SPARK-35050, April 2021).[4] The Mesos board reports record attic discussions again in 2023 and a request in February 2024 to hold off, before the board terminated the project in 2025.[7] By then Spark had already removed the integration from its main branch in September 2023, in the work that became Spark 4.0.0.[1]
How it worked
A Spark application used Mesos by setting its master URL to mesos://host:5050, or to mesos://zk://host1:2181,host2:2181/mesos for a Mesos cluster with several masters coordinated through ZooKeeper.[2] The Spark 3.5 documentation describes two scheduling modes, chosen with spark.mesos.coarse:[2]
- Coarse-grained mode (default,
spark.mesos.coarse=true): Spark acquired one long-lived Mesos task per machine and ran an executor in it, much like executors on other cluster managers. - Fine-grained mode (
spark.mesos.coarse=false, deprecated since 2.0.0): Spark created one Mesos task for each Spark task, so cores moved between applications as tasks finished, at the cost of higher task launch overhead.
For cluster deploy mode, operators ran the MesosClusterDispatcher (started with sbin/start-mesos-dispatcher.sh) and submitted applications to its URL. The documentation warned that the dispatcher had no authentication.[2]
# Spark 3.5 and earlier only; in Spark 4.0 spark-submit accepts only yarn, spark://, k8s:// and local masters
./bin/spark-shell --master mesos://host:5050
Migrating off Mesos
Applications that ran on Mesos need another cluster manager to move to Spark 4. Spark 4.0 documents three: the standalone cluster manager, Hadoop YARN and Kubernetes.[10] Kubernetes is the closest match for a shared, multi-tenant cluster: each executor runs in its own pod, as each coarse-grained executor ran in its own Mesos task. All spark.mesos.* settings stop having any effect and should be removed from configuration files. See Spark 3 to Spark 4 migration for the other changes in the same release.
See also
References
- ↑ 1.0 1.1 1.2 1.3 SPARK-44442: Drop mesos support. Apache Software Foundation JIRA.Retrieved 2026-11-22.
- ↑ 2.0 2.1 2.2 2.3 2.4 Running Spark on Mesos (docs/running-on-mesos.md at v3.5.0). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ 3.0 3.1 3.2 Migration Guide: Spark Core (docs/core-migration-guide.md at v4.0.0). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ 4.0 4.1 SPARK-35050: Deprecate Apache Mesos as resource manager. Apache Software Foundation JIRA.Retrieved 2026-11-22.
- ↑ Spark Release 4.0.0. Apache Software Foundation.Retrieved 2026-11-22.
- ↑ Running Spark on Mesos (docs/running-on-mesos.md at v3.1.1). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ 7.0 7.1 Board minutes: Mesos. Apache Software Foundation.Retrieved 2026-11-22.
- ↑ Apache Mesos (Apache Attic). Apache Software Foundation.Retrieved 2026-11-22.
- ↑ Spark: Cluster Computing with Working Sets. USENIX HotCloud 2010.Retrieved 2026-11-22.
- ↑ Cluster Mode Overview (docs/cluster-overview.md at v4.0.0). Apache Software Foundation.Retrieved 2026-11-22.