I have an Spark app which runs with no problem in local mode,but have some problems when submitting to the Spark cluster.
The error msg are as follows:
The default value of "spark.master" is spark://HOST:PORT, and the following code tries to get a session from the standalone cluster that is running at HOST:PORT, and expects the HOST:PORT value to be in the spark config file.
SparkSession spark = SparkSession
.builder()
.appName("SomeAppName")
.getOrCreate();
"org.apache.spark.SparkException: A master URL must be set in your configuration" states that HOST:PORT is not set in the spark configuration file.
To not bother about value of "HOST:PORT", set spark.master as local
SparkSession spark = SparkSession
.builder()
.appName("SomeAppName")
.config("spark.master", "local")
.getOrCreate();
Here is the link for list of formats in which master URL can be passed to spark.master
Reference : Spark Tutorial - Setup Spark Ecosystem