diff options
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/scala/org/apache/spark/ui/WebUI.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/src/main/scala/org/apache/spark/ui/WebUI.scala b/core/src/main/scala/org/apache/spark/ui/WebUI.scala index fe4949b9f6..23d312525f 100644 --- a/core/src/main/scala/org/apache/spark/ui/WebUI.scala +++ b/core/src/main/scala/org/apache/spark/ui/WebUI.scala @@ -134,8 +134,10 @@ private[spark] abstract class WebUI( def bind() { assert(!serverInfo.isDefined, "Attempted to bind %s more than once!".format(className)) try { - serverInfo = Some(startJettyServer("0.0.0.0", port, sslOptions, handlers, conf, name)) - logInfo("Started %s at http://%s:%d".format(className, publicHostName, boundPort)) + var host = Option(conf.getenv("SPARK_LOCAL_IP")).getOrElse("0.0.0.0") + serverInfo = Some(startJettyServer(host, port, sslOptions, handlers, conf, name)) + logInfo("Bound %s to %s, and started at http://%s:%d".format(className, host, + publicHostName, boundPort)) } catch { case e: Exception => logError("Failed to bind %s".format(className), e) |