Error while launching spark shell


Unable to launch spark-shell

ERROR SparkUI: Failed to bind SparkUI Address already in use: Service ‘SparkUI’ failed after 16 retries! Consider explicitly setting the appropriate port for the service ‘SparkUI’ (for example spark.ui.port for SparkUI) to an available port or increasing spark.port.maxRetries.

Please check.



You can resolve it either following any one of following solutions:

Solution-1: Set Spark UI Port explicitly as shown below

spark-shell --conf “spark.ui.port=10101”
//Here we are explicitly setting spark ui port to some random port which is not in use and in above example I chosen 10101 but you can choose any proper port number

Solution-2: Increase spark.port.maxRetries as shown below

spark-shell --conf “spark.port.maxRetries=100”
//Here we are setting spark.port.maxRetries to 100 so it will try maximum of 100 instead of 16 to find some unused port


thank you !! its working