Skip to content
Snippets Groups Projects
Commit be6d96c1 authored by Patrick Wendell's avatar Patrick Wendell
Browse files

SPARK-1324: SparkUI Should Not Bind to SPARK_PUBLIC_DNS

/cc @aarondav and @andrewor14

Author: Patrick Wendell <pwendell@gmail.com>

Closes #231 from pwendell/ui-binding and squashes the following commits:

e8025f8 [Patrick Wendell] SPARK-1324: SparkUI Should Not Bind to SPARK_PUBLIC_DNS
parent e15e5741
No related branches found
No related tags found
No related merge requests found
...@@ -47,7 +47,8 @@ private[spark] class SparkUI( ...@@ -47,7 +47,8 @@ private[spark] class SparkUI(
val securityManager = if (live) sc.env.securityManager else new SecurityManager(conf) val securityManager = if (live) sc.env.securityManager else new SecurityManager(conf)
private val host = Option(System.getenv("SPARK_PUBLIC_DNS")).getOrElse(Utils.localHostName()) private val bindHost = Utils.localHostName()
private val publicHost = Option(System.getenv("SPARK_PUBLIC_DNS")).getOrElse(bindHost)
private val port = conf.get("spark.ui.port", SparkUI.DEFAULT_PORT).toInt private val port = conf.get("spark.ui.port", SparkUI.DEFAULT_PORT).toInt
private var serverInfo: Option[ServerInfo] = None private var serverInfo: Option[ServerInfo] = None
...@@ -79,8 +80,8 @@ private[spark] class SparkUI( ...@@ -79,8 +80,8 @@ private[spark] class SparkUI(
/** Bind the HTTP server which backs this web interface */ /** Bind the HTTP server which backs this web interface */
def bind() { def bind() {
try { try {
serverInfo = Some(startJettyServer(host, port, handlers, sc.conf)) serverInfo = Some(startJettyServer(bindHost, port, handlers, sc.conf))
logInfo("Started Spark Web UI at http://%s:%d".format(host, boundPort)) logInfo("Started Spark Web UI at http://%s:%d".format(publicHost, boundPort))
} catch { } catch {
case e: Exception => case e: Exception =>
logError("Failed to create Spark JettyUtils", e) logError("Failed to create Spark JettyUtils", e)
...@@ -111,7 +112,7 @@ private[spark] class SparkUI( ...@@ -111,7 +112,7 @@ private[spark] class SparkUI(
logInfo("Stopped Spark Web UI at %s".format(appUIAddress)) logInfo("Stopped Spark Web UI at %s".format(appUIAddress))
} }
private[spark] def appUIAddress = "http://" + host + ":" + boundPort private[spark] def appUIAddress = "http://" + publicHost + ":" + boundPort
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment