I start my Spark session in Jupyter with something like this:
from pyspark.sql import SparkSession
spark = ( SparkSession
.builder
.appName('analysis')
.getOrCreate() )
Is there a way to find out which port the web UI is using? Thanks!
You can use uiWebUrl
property:
>>> spark.sparkContext.uiWebUrl
'http://some_host:4040'
and for example split
>>> spark.sparkContext.uiWebUrl.split(":")[-1]
'4040'
This is how I figured it out in pyspark.
>>> import pyspark
>>> sc = pyspark.SparkContext(appName="some_app")
>>> sc.uiWebUrl
[1]: http://localhost:4041/jobs/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With