Skip to content

Commit

Permalink
Start HTTP server only on the driver
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewor14 committed Jul 8, 2014
1 parent e6f7bfc commit 46ef263
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions core/src/main/scala/org/apache/spark/SparkEnv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class SparkEnv (

private[spark] def stop() {
pythonWorkers.foreach { case(key, worker) => worker.stop() }
httpFileServer.stop()
Option(httpFileServer).foreach(_.stop())
mapOutputTracker.stop()
shuffleManager.stop()
broadcastManager.stop()
Expand Down Expand Up @@ -228,9 +228,15 @@ object SparkEnv extends Logging {

val cacheManager = new CacheManager(blockManager)

val httpFileServer = new HttpFileServer(securityManager)
httpFileServer.initialize()
conf.set("spark.fileserver.uri", httpFileServer.serverUri)
val httpFileServer =
if (isDriver) {
val server = new HttpFileServer(securityManager)
server.initialize()
conf.set("spark.fileserver.uri", server.serverUri)
server
} else {
null
}

val metricsSystem = if (isDriver) {
MetricsSystem.createMetricsSystem("driver", conf, securityManager)
Expand Down

0 comments on commit 46ef263

Please sign in to comment.