Skip to content

Commit

Permalink
Update docs to reflect new ports
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewor14 committed Aug 5, 2014
1 parent b565079 commit de1b207
Show file tree
Hide file tree
Showing 3 changed files with 192 additions and 114 deletions.
53 changes: 53 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,13 +558,66 @@ Apart from these, the following properties are also available, and may be useful
<td>(local hostname)</td>
<td>
Hostname or IP address for the driver to listen on.
This is used for communicating with the executors and the standalone Master.
</td>
</tr>
<tr>
<td><code>spark.driver.port</code></td>
<td>(random)</td>
<td>
Port for the driver to listen on.
This is used for communicating with the executors and the standalone Master.
</td>
</tr>
<tr>
<td><code>spark.fileserver.port</code></td>
<td>(random)</td>
<td>
Port for the driver's HTTP file server to listen on.
</td>
</tr>
<tr>
<td><code>spark.broadcast.port</code></td>
<td>(random)</td>
<td>
Port for the driver's HTTP broadcast server to listen on.
This is not relevant for torrent broadcast.
</td>
</tr>
<tr>
<td><code>spark.replClassServer.port</code></td>
<td>(random)</td>
<td>
Port for the driver's HTTP class server to listen on.
This is only relevant for Spark shell.
</td>
</tr>
<tr>
<td><code>spark.blockManager.port</code></td>
<td>(random)</td>
<td>
Port for all block managers to listen on. These exist on both the driver and the executors.
</td>
</tr>
<tr>
<td><code>spark.executor.port</code></td>
<td>(random)</td>
<td>
Port for the executor to listen on. This is used for communicating with the driver.
</td>
</tr>
<tr>
<td><code>spark.executor.env.port</code></td>
<td>(random)</td>
<td>
Port used by the executor's actor system for various purposes.
</td>
</tr>
<tr>
<td><code>spark.standalone.cluster.port</code></td>
<td>(random)</td>
<td>
Port used by <code>org.apache.spark.deploy.Client</code> in standalone cluster deploy mode.
</td>
</tr>
<tr>
Expand Down
139 changes: 136 additions & 3 deletions docs/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,147 @@ Spark currently supports authentication via a shared secret. Authentication can

* For Spark on [YARN](running-on-yarn.html) deployments, configuring `spark.authenticate` to `true` will automatically handle generating and distributing the shared secret. Each application will use a unique shared secret.
* For other types of Spark deployments, the Spark parameter `spark.authenticate.secret` should be configured on each of the nodes. This secret will be used by all the Master/Workers and applications.
* **IMPORTANT NOTE:** *The experimental Netty shuffle path (`spark.shuffle.use.netty`) is not secured, so do not use Netty for shuffles if running with authentication.*

## Web UI

The Spark UI can also be secured by using [javax servlet filters](http://docs.oracle.com/javaee/6/api/javax/servlet/Filter.html) via the `spark.ui.filters` setting. A user may want to secure the UI if it has data that other users should not be allowed to see. The javax servlet filter specified by the user can authenticate the user and then once the user is logged in, Spark can compare that user versus the view ACLs to make sure they are authorized to view the UI. The configs `spark.ui.acls.enable` and `spark.ui.view.acls` control the behavior of the ACLs. Note that the user who started the application always has view access to the UI.
On YARN, the Spark UI uses the standard YARN web application proxy mechanism and will authenticate via any installed Hadoop filters.

## Event Logging

If your applications are using event logging, the directory where the event logs go (`spark.eventLog.dir`) should be manually created and have the proper permissions set on it. If you want those log files secured, the permissions should be set to `drwxrwxrwxt` for that directory. The owner of the directory should be the super user who is running the history server and the group permissions should be restricted to super user group. This will allow all users to write to the directory but will prevent unprivileged users from removing or renaming a file unless they own the file or directory. The event log files will be created by Spark with permissions such that only the user and group have read and write access.

**IMPORTANT NOTE:** *The experimental Netty shuffle path (`spark.shuffle.use.netty`) is not secured, so do not use Netty for shuffles if running with authentication.*
## Configuring Ports for Network Security

Spark makes heavy use of the network, and some environments have strict requirements for using tight
firewall settings. Below are the primary ports that Spark uses for its communication and how to
configure those ports.

### Standalone mode only

<table class="table">
<tr>
<th>From</th><th>To</th><th>Default Port</th><th>Purpose</th><th>Configuration
Setting</th><th>Notes</th>
</tr>
<tr>
<td>Browser</td>
<td>Standalone Master</td>
<td>8080</td>
<td>Web UI</td>
<td><code>master.ui.port<br>SPARK_MASTER_WEBUI_PORT</code></td>
<td>Jetty-based. Standalone mode only.</td>
</tr>
<tr>
<td>Browser</td>
<td>Standalone Worker</td>
<td>8081</td>
<td>Web UI</td>
<td><code>worker.ui.port<br>SPARK_WORKER_WEBUI_PORT</code></td>
<td>Jetty-based. Standalone mode only.</td>
</tr>
<tr>
<td>Driver<br>Standalone Worker</td>
<td>Standalone Master</td>
<td>7077</td>
<td>Submit job to cluster<br>Join cluster</td>
<td><code>SPARK_MASTER_PORT</code></td>
<td>Akka-based. Set to "0" to choose a port randomly. Standalone mode only.</td>
</tr>
<tr>
<td>Standalone Master</td>
<td>Standalone Worker</td>
<td>(random)</td>
<td>Schedule executors</td>
<td><code>SPARK_WORKER_PORT</code></td>
<td>Akka-based. Set to "0" to choose a port randomly. Standalone mode only.</td>
</tr>
</table>

### All cluster managers

<table class="table">
<tr>
<th>From</th><th>To</th><th>Default Port</th><th>Purpose</th><th>Configuration
Setting</th><th>Notes</th>
</tr>
<tr>
<td>Browser</td>
<td>Application</td>
<td>4040</td>
<td>Web UI</td>
<td><code>spark.ui.port</code></td>
<td>Jetty-based</td>
</tr>
<tr>
<td>Browser</td>
<td>History Server</td>
<td>18080</td>
<td>Web UI</td>
<td><code>spark.history.ui.port</code></td>
<td>Jetty-based</td>
</tr>
<tr>
<td>Executor<br>Standalone Master</td>
<td>Driver</td>
<td>(random)</td>
<td>Connect to application<br>Notify executor state changes</td>
<td><code>spark.driver.port</code></td>
<td>Akka-based. Set to "0" to choose a port randomly.</td>
</tr>
<tr>
<td>Driver</td>
<td>Executor</td>
<td>(random)</td>
<td>Schedule tasks</td>
<td><code>spark.executor.port</code></td>
<td>Akka-based. Set to "0" to choose a port randomly.</td>
</tr>
<tr>
<td>Driver</td>
<td>Executor</td>
<td>(random)</td>
<td>Executor actor system port</td>
<td><code>spark.executor.env.port</code></td>
<td>Akka-based. Set to "0" to choose a port randomly.</td>
</tr>
<tr>
<td>Executor</td>
<td>Driver</td>
<td>(random)</td>
<td>File server for files and jars</td>
<td><code>spark.fileserver.port</code></td>
<td>Jetty-based</td>
</tr>
<tr>
<td>Executor</td>
<td>Driver</td>
<td>(random)</td>
<td>HTTP Broadcast</td>
<td><code>spark.broadcast.port</code></td>
<td>Jetty-based. Not used by TorrentBroadcast, which sends data through the block manager
instead.</td>
</tr>
<tr>
<td>Executor</td>
<td>Driver</td>
<td>(random)</td>
<td>Class file server</td>
<td><code>spark.replClassServer.port</code></td>
<td>Jetty-based. Only used in Spark shells.</td>
</tr>
<tr>
<td>Executor / Driver</td>
<td>Executor / Driver</td>
<td>(random)</td>
<td>Block Manager port</td>
<td><code>spark.blockManager.port</code></td>
<td>Raw socket via ServerSocketChannel</td>
</tr>
</table>

See the [configuration page](configuration.html) for more details on the security configuration parameters.

See <a href="{{site.SPARK_GITHUB_URL}}/tree/master/core/src/main/scala/org/apache/spark/SecurityManager.scala"><code>org.apache.spark.SecurityManager</code></a> for implementation details about security.
See the [configuration page](configuration.html) for more details on the security configuration
parameters, and <a href="{{site.SPARK_GITHUB_URL}}/tree/master/core/src/main/scala/org/apache/spark/SecurityManager.scala">
<code>org.apache.spark.SecurityManager</code></a> for implementation details about security.
114 changes: 3 additions & 111 deletions docs/spark-standalone.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,118 +299,10 @@ You can run Spark alongside your existing Hadoop cluster by just launching it as

# Configuring Ports for Network Security

Spark makes heavy use of the network, and some environments have strict requirements for using tight
firewall settings. Below are the primary ports that Spark uses for its communication and how to
configure those ports.
Spark makes heavy use of the network, and some environments have strict requirements for using
tight firewall settings. For a complete list of ports to configure, see the [security page]
(security.html#configuring-ports-for-network-security).

<table class="table">
<tr>
<th>From</th><th>To</th><th>Default Port</th><th>Purpose</th><th>Configuration
Setting</th><th>Notes</th>
</tr>
<!-- Web UIs -->
<tr>
<td>Browser</td>
<td>Master</td>
<td>8080</td>
<td>Web UI</td>
<td><code>master.ui.port<br>SPARK_MASTER_WEBUI_PORT</code></td>
<td>Jetty-based</td>
</tr>
<tr>
<td>Browser</td>
<td>Worker</td>
<td>8081</td>
<td>Web UI</td>
<td><code>worker.ui.port<br>SPARK_WORKER_WEBUI_PORT</code></td>
<td>Jetty-based</td>
</tr>
<tr>
<td>Browser</td>
<td>Application</td>
<td>4040</td>
<td>Web UI</td>
<td><code>spark.ui.port</code></td>
<td>Jetty-based</td>
</tr>
<tr>
<td>Browser</td>
<td>History Server</td>
<td>18080</td>
<td>Web UI</td>
<td><code>spark.history.ui.port</code></td>
<td>Jetty-based</td>
</tr>
<!-- Cluster interactions -->
<tr>
<td>Driver<br>Worker</td>
<td>Master</td>
<td>7077</td>
<td>Submit job to cluster<br>Join cluster</td>
<td><code>SPARK_MASTER_PORT</code></td>
<td>Akka-based. Set to "0" to choose a port randomly.</td>
</tr>
<tr>
<td>Master</td>
<td>Worker</td>
<td>(random)</td>
<td>Schedule executors</td>
<td><code>SPARK_WORKER_PORT</code></td>
<td>Akka-based. Set to "0" to choose a port randomly.</td>
</tr>
<tr>
<td>Executor<br>Master</td>
<td>Driver</td>
<td>(random)</td>
<td>Connect to application<br>Notify Master and executor state changes</td>
<td><code>spark.driver.port</code></td>
<td>Akka-based. Set to "0" to choose a port randomly.</td>
</tr>
<tr>
<td>Driver</td>
<td>Executor</td>
<td>(random)</td>
<td>Schedule tasks</td>
<td><code>spark.executor.port</code></td>
<td>Akka-based. Set to "0" to choose a port randomly.</td>
</tr>

<!-- Other misc stuff -->
<tr>
<td>Executor</td>
<td>Driver</td>
<td>(random)</td>
<td>File server for files and jars</td>
<td><code>spark.fileserver.port</code></td>
<td>Jetty-based</td>
</tr>
<tr>
<td>Executor</td>
<td>Driver</td>
<td>(random)</td>
<td>HTTP Broadcast</td>
<td><code>spark.broadcast.port</code></td>
<td>Jetty-based. Not used by TorrentBroadcast, which sends data through the block manager
instead.</td>
</tr>
<tr>
<td>Executor</td>
<td>Driver</td>
<td>(random)</td>
<td>Class file server</td>
<td><code>spark.replClassServer.port</code></td>
<td>Jetty-based. Only used in Spark shells.</td>
</tr>
<tr>
<td>Executor</td>
<td>Executor</td>
<td>(random)</td>
<td>Block Manager port</td>
<td><code>spark.blockManager.port</code></td>
<td>Raw socket via ServerSocketChannel</td>
</tr>

</table>

# High Availability

Expand Down

0 comments on commit de1b207

Please sign in to comment.