--- layout: global title: Running Spark on Mesos --- * This will become a table of contents (this text will be scraped). {:toc} Spark can run on hardware clusters managed by [Apache Mesos](http://mesos.apache.org/). The advantages of deploying Spark with Mesos include: - dynamic partitioning between Spark and other [frameworks](https://mesos.apache.org/documentation/latest/mesos-frameworks/) - scalable partitioning between multiple instances of Spark # How it Works In a standalone cluster deployment, the cluster manager in the below diagram is a Spark master instance. When using Mesos, the Mesos master replaces the Spark master as the cluster manager.
Property Name | Default | Meaning |
---|---|---|
spark.mesos.coarse |
true |
If set to true , runs over Mesos clusters in "coarse-grained" sharing mode, where Spark acquires one long-lived Mesos task on each machine.
If set to false , runs over Mesos cluster in "fine-grained" sharing mode, where one Mesos task is created per Spark task.
Detailed information in 'Mesos Run Modes'.
|
spark.mesos.extra.cores |
0 |
Set the extra number of cores for an executor to advertise. This does not result in more cores allocated. It instead means that an executor will "pretend" it has more cores, so that the driver will send it more tasks. Use this to increase parallelism. This setting is only used for Mesos coarse-grained mode. |
spark.mesos.mesosExecutor.cores |
1.0 |
(Fine-grained mode only) Number of cores to give each Mesos executor. This does not include the cores used to run the Spark tasks. In other words, even if no Spark task is being run, each Mesos executor will occupy the number of cores configured here. The value can be a floating point number. |
spark.mesos.executor.docker.image |
(none) |
Set the name of the docker image that the Spark executors will run in. The selected
image must have Spark installed, as well as a compatible version of the Mesos library.
The installed path of Spark in the image can be specified with spark.mesos.executor.home ;
the installed path of the Mesos library can be specified with spark.executorEnv.MESOS_NATIVE_JAVA_LIBRARY .
|
spark.mesos.executor.docker.forcePullImage |
false |
Force Mesos agents to pull the image specified in spark.mesos.executor.docker.image .
By default Mesos agents will not pull images they already have cached.
|
spark.mesos.executor.docker.volumes |
(none) |
Set the list of volumes which will be mounted into the Docker image, which was set using
spark.mesos.executor.docker.image . The format of this property is a comma-separated list of
mappings following the form passed to docker run -v . That is they take the form:
[host_path:]container_path[:ro|:rw] |
spark.mesos.executor.docker.portmaps |
(none) |
Set the list of incoming ports exposed by the Docker image, which was set using
spark.mesos.executor.docker.image . The format of this property is a comma-separated list of
mappings which take the form:
host_port:container_port[:tcp|:udp] |
spark.mesos.executor.home |
driver side SPARK_HOME |
Set the directory in which Spark is installed on the executors in Mesos. By default, the
executors will simply use the driver's Spark home directory, which may not be visible to
them. Note that this is only relevant if a Spark binary package is not specified through
spark.executor.uri .
|
spark.mesos.executor.memoryOverhead |
executor memory * 0.10, with minimum of 384 |
The amount of additional memory, specified in MB, to be allocated per executor. By default,
the overhead will be larger of either 384 or 10% of spark.executor.memory . If set,
the final overhead will be this value.
|
spark.mesos.uris |
(none) | A comma-separated list of URIs to be downloaded to the sandbox when driver or executor is launched by Mesos. This applies to both coarse-grained and fine-grained mode. |
spark.mesos.principal |
(none) | Set the principal with which Spark framework will use to authenticate with Mesos. |
spark.mesos.secret |
(none) | Set the secret with which Spark framework will use to authenticate with Mesos. |
spark.mesos.role |
* |
Set the role of this Spark framework for Mesos. Roles are used in Mesos for reservations and resource weight sharing. |
spark.mesos.constraints |
(none) |
Attribute based constraints on mesos resource offers. By default, all resource offers will be accepted. Refer to Mesos Attributes & Resources for more information on attributes.
|
spark.mesos.containerizer |
docker |
This only affects docker containers, and must be one of "docker" or "mesos". Mesos supports two types of containerizers for docker: the "docker" containerizer, and the preferred "mesos" containerizer. Read more here: http://mesos.apache.org/documentation/latest/container-image/ |
spark.mesos.driver.webui.url |
(none) |
Set the Spark Mesos driver webui_url for interacting with the framework. If unset it will point to Spark's internal web UI. |
spark.mesos.driverEnv.[EnvironmentVariableName] |
(none) |
This only affects drivers submitted in cluster mode. Add the environment variable specified by EnvironmentVariableName to the driver process. The user can specify multiple of these to set multiple environment variables. |
spark.mesos.dispatcher.webui.url |
(none) |
Set the Spark Mesos dispatcher webui_url for interacting with the framework. If unset it will point to Spark's internal web UI. |
spark.mesos.dispatcher.historyServer.url |
(none) |
Set the URL of the history server. The dispatcher will then link each driver to its entry in the history server. |