diff options
author | Marcelo Vanzin <vanzin@cloudera.com> | 2016-09-21 14:42:41 -0700 |
---|---|---|
committer | Shixiong Zhu <shixiong@databricks.com> | 2016-09-21 14:42:41 -0700 |
commit | 2cd1bfa4f0c6625b0ab1dbeba2b9586b9a6a9f42 (patch) | |
tree | f0734e443661a59da6b14d496aeacd16809ecb86 /docs/configuration.md | |
parent | b4a4421b610e776e5280fd5e7453f937f806cbd1 (diff) | |
download | spark-2cd1bfa4f0c6625b0ab1dbeba2b9586b9a6a9f42.tar.gz spark-2cd1bfa4f0c6625b0ab1dbeba2b9586b9a6a9f42.tar.bz2 spark-2cd1bfa4f0c6625b0ab1dbeba2b9586b9a6a9f42.zip |
[SPARK-4563][CORE] Allow driver to advertise a different network address.
The goal of this feature is to allow the Spark driver to run in an
isolated environment, such as a docker container, and be able to use
the host's port forwarding mechanism to be able to accept connections
from the outside world.
The change is restricted to the driver: there is no support for achieving
the same thing on executors (or the YARN AM for that matter). Those still
need full access to the outside world so that, for example, connections
can be made to an executor's block manager.
The core of the change is simple: add a new configuration that tells what's
the address the driver should bind to, which can be different than the address
it advertises to executors (spark.driver.host). Everything else is plumbing
the new configuration where it's needed.
To use the feature, the host starting the container needs to set up the
driver's port range to fall into a range that is being forwarded; this
required the block manager port to need a special configuration just for
the driver, which falls back to the existing spark.blockManager.port when
not set. This way, users can modify the driver settings without affecting
the executors; it would theoretically be nice to also have different
retry counts for driver and executors, but given that docker (at least)
allows forwarding port ranges, we can probably live without that for now.
Because of the nature of the feature it's kinda hard to add unit tests;
I just added a simple one to make sure the configuration works.
This was tested with a docker image running spark-shell with the following
command:
docker blah blah blah \
-p 38000-38100:38000-38100 \
[image] \
spark-shell \
--num-executors 3 \
--conf spark.shuffle.service.enabled=false \
--conf spark.dynamicAllocation.enabled=false \
--conf spark.driver.host=[host's address] \
--conf spark.driver.port=38000 \
--conf spark.driver.blockManager.port=38020 \
--conf spark.ui.port=38040
Running on YARN; verified the driver works, executors start up and listen
on ephemeral ports (instead of using the driver's config), and that caching
and shuffling (without the shuffle service) works. Clicked through the UI
to make sure all pages (including executor thread dumps) worked. Also tested
apps without docker, and ran unit tests.
Author: Marcelo Vanzin <vanzin@cloudera.com>
Closes #15120 from vanzin/SPARK-4563.
Diffstat (limited to 'docs/configuration.md')
-rw-r--r-- | docs/configuration.md | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/docs/configuration.md b/docs/configuration.md index b50565367a..82ce232b33 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1069,10 +1069,31 @@ Apart from these, the following properties are also available, and may be useful </td> </tr> <tr> + <td><code>spark.driver.blockManager.port</code></td> + <td>(value of spark.blockManager.port)</td> + <td> + Driver-specific port for the block manager to listen on, for cases where it cannot use the same + configuration as executors. + </td> +</tr> +<tr> + <td><code>spark.driver.bindAddress</code></td> + <td>(value of spark.driver.host)</td> + <td> + <p>Hostname or IP address where to bind listening sockets. This config overrides the SPARK_LOCAL_IP + environment variable (see below).</p> + + <p>It also allows a different address from the local one to be advertised to executors or external systems. + This is useful, for example, when running containers with bridged networking. For this to properly work, + the different ports used by the driver (RPC, block manager and UI) need to be forwarded from the + container's host.</p> + </td> +</tr> +<tr> <td><code>spark.driver.host</code></td> <td>(local hostname)</td> <td> - Hostname or IP address for the driver to listen on. + Hostname or IP address for the driver. This is used for communicating with the executors and the standalone Master. </td> </tr> |