‘SparkUI’ could not bind on port 4040

apache-spark

#1

Hi Durga,

i am getting this error in pySpark when i run the first program: [windows 10]

C:\Users\Sunny\PycharmProjects\gettingstarted\venv\Scripts\python.exe C:/Users/Sunny/PycharmProjects/gettingstarted/sparkdemo.py
18/02/17 20:00:03 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform… using builtin-java classes where applicable
18/02/17 20:00:04 WARN Utils: Service ‘SparkUI’ could not bind on port 4040. Attempting port 4041.
18/02/17 20:00:04 WARN Utils: Service ‘SparkUI’ could not bind on port 4041. Attempting port 4042.
BLACK|SPADE|2

Process finished with exit code 0

my install was:

spark-2.2.1-bin-hadoop2.7.tgz

python 3.6.3

pls advice what can i do to fix this ?


#2

Hi,
We usually face this error when you already have a Spark cluster running.
Try turning off the cluster, and try then. Does the error persist?


#3

You need to use below command to see if there are any process running or using port

#sudo ss -lptn ‘sport = :4040’

And kill the process.

kill -9