-1

In Azure VM, I have installed standalone Spark 4.0. On the same VM I have Python 3.11 with Jupyter deployed. In my notebook I submitted the following program:

from pyspark.sql import SparkSession
spark = SparkSession.builder.remote("sc://192.168.2.5:15002").getOrCreate()
df = spark.range(10)
df.show() 

Everything works fine. Now I'm trying to read sample data, submitting the following program:

UsersDF=spark.read.load("examples/src/main/resources/users.parquet","parquet")
UsersDF.show()

This program generates the following error message:

UnknownException: (java.net.ConnectException) Call From vm-name/192.168.2.5 to vm-name.internal.cloudapp.net:9001 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused

I'd be grateful for any suggestions on how to fix it!

DarkBee
14.4k9 gold badges86 silver badges135 bronze badges
asked Nov 24, 2025 at 16:16
1
  • You are trying to connect to: "sc://192.168.2.5:15002" do you have the Spark cluster with connect service running? Commented Nov 24, 2025 at 20:23

2 Answers 2

0

The error message is completely misleading. The path should be written in the following way. It works without any further problems

UsersDF=spark.read.load("file:///examples/src/main/resources/users.parquet","parquet")
answered Nov 27, 2025 at 23:32
Sign up to request clarification or add additional context in comments.

Comments

-1

Fort standalone Spark see this example, do not connect to sc://192.168.2.5:15002 which is Spark connect port. If you want Spark connect, then you need to make sure the service is running.

answered Nov 24, 2025 at 20:26

2 Comments

Yes Spark connect is up and running
Then you need to open 15002 port on the VM. use lsof -i -P -n | grep LISTEN to list open ports.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.