Skip to content

Commit

Permalink
[SPARK-18762][WEBUI] Web UI should be http:4040 instead of https:4040
Browse files Browse the repository at this point in the history
## What changes were proposed in this pull request?

When SSL is enabled, the Spark shell shows:
```
Spark context Web UI available at https://192.168.99.1:4040
```
This is wrong because 4040 is http, not https. It redirects to the https port.
More importantly, this introduces several broken links in the UI. For example, in the master UI, the worker link is https:8081 instead of http:8081 or https:8481.

CC: mengxr liancheng

I manually tested accessing by accessing MasterPage, WorkerPage and HistoryServer with SSL enabled.

Author: sarutak <[email protected]>

Closes apache#16190 from sarutak/SPARK-18761.
  • Loading branch information
sarutak authored and Marcelo Vanzin committed Dec 7, 2016
1 parent dbf3e29 commit bb94f61
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ private[deploy] class Worker(
webUi = new WorkerWebUI(this, workDir, webUiPort)
webUi.bind()

val scheme = if (webUi.sslOptions.enabled) "https" else "http"
workerWebUiUrl = s"$scheme://$publicAddress:${webUi.boundPort}"
workerWebUiUrl = s"http://$publicAddress:${webUi.boundPort}"
registerWithMaster()

metricsSystem.registerSource(workerSource)
Expand Down
5 changes: 1 addition & 4 deletions core/src/main/scala/org/apache/spark/ui/WebUI.scala
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,7 @@ private[spark] abstract class WebUI(
}

/** Return the url of web interface. Only valid after bind(). */
def webUrl: String = {
val protocol = if (sslOptions.enabled) "https" else "http"
s"$protocol://$publicHostName:$boundPort"
}
def webUrl: String = s"http://$publicHostName:$boundPort"

/** Return the actual port to which this server is bound. Only valid after bind(). */
def boundPort: Int = serverInfo.map(_.boundPort).getOrElse(-1)
Expand Down

0 comments on commit bb94f61

Please sign in to comment.