org.apache.spark.SparkException: A master URL must be set in your configuration

Ads
 

org.apache.spark.SparkException: A master URL must be set in your configuration

Hi,

I my program following error is thrown:

org.apache.spark.SparkException: A master URL must be set in your configuration

How to fix it?

thanks

View Answers

October 24, 2018 at 4:30 AM

Hi,

I used following code:

val conf = new SparkConf().setAppName("MyApp")

val sc = new SparkContext(conf)

Thanks


October 24, 2018 at 4:31 AM

Hi,

You should set mater:

.setMaster("local[2]")

Full code:

val conf = new SparkConf().setAppName("MyApp").setMaster("local[2]")

val sc = new SparkContext(conf)

Thanks


October 24, 2018 at 4:32 AM

Hi,

You can also write like this:

 SparkConf configuration = new SparkConf()
            .setAppName("Your Application Name")
            .setMaster("local");
 val sc = new SparkContext(conf);

Thanks

Ads









Related Tutorials/Questions & Answers:
UIImageView set Image URL
UIImageView set Image URL  Show image by URL   UIImageView set image url Create NSURL object and add the Image URL to it. Create NSData and add the NSURL object to it. Now, create UIImage and pass the NSData value
The path to the driver executable must be set by the webdriver.gecko.driver system property
The path to the driver executable must be set by the webdriver.gecko.driver system property  Hi, How to solve following error while using..." java.lang.IllegalStateException: The path to the driver executable must be set
Advertisements
Spring Null value, Set null value in Springs configuration file
Spring Null value, Set null value in Springs configuration file In this example you will see how to set null value in the Spring configuration file. NullBean.java package spring.nullvalue.example
URL Encoding and URL Decoding
URL Encoding and URL Decoding  What is URL Encoding and URL Decoding ?   URL encoding is the method of replacing all the spaces and other extra characters into their corresponding Hex Characters and Decoding
MySQL Configuration
the Standard option then the cause the mysql configuration wizard set all... MySQL Configuration      ... you will also read how to easily configuring your server under window . The mysql
MySQL Configuration
from bin directory of your MySQL installation. The MySQL server configuration... MySQL Configuration      ... . The MySQL server configuration normally started during  installation process
invalid configuration
configuration Exception in thread "main" java.lang.ExceptionInInitializerError... configuration at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2241..., it must match "(property,mapping+,(class-cache|collection-cache|jcs-class-cache
Hibernate Configuration File
Hibernate Configuration File In this section we will read about the hibernate configuration file. In this file we will see how we can provide the database connection information to a file. Hibernate Configuration file i.e.
PHP Variables from URL
to the next page and your whole information will appear in the url.  But sometime it will create problem for you to show your information in the URL. How see... in the above URL and it is not advisable to use this method because anyone get your
Friendly URl
Friendly URl  creating a SEO friendly URL
SET Syntax
SET Syntax       The general syntax of SET statement is :   SET variable_assignment.... | @@]system_var_name = expr SET statement is used for assigning the values
Identify the interfaces and methods a CMP entity bean must and must not implement.
). The entity bean class MUST implement the get and set accessor methods... Identify the interfaces and methods a CMP entity bean must and must... the interfaces and methods a CMP entity bean must and must not implement. 
Version of com.rebaze>master dependency
List of Version of com.rebaze>master dependency
URL problem
URL problem  Hi. I have created a webpage for my project website. in that i have used frameset to split the page. Now if i click any link in the page its navigating to the another page. but the problem is here in the url its
Maven Dependency master >> 0.1.2
You should include the dependency code given in this page to add Maven Dependency of com.rebaze >> master version0.1.2 in your project
Maven Dependency master >> 2
You should include the dependency code given in this page to add Maven Dependency of com.rebaze >> master version2 in your project
hide url
hide url  how i can hide url i have lot of jsp pages when i call one jsp in address another jsp page name also displayed in the address bar? url not visible to endusers please tell me any answer what i should do
Version of excalibur-configuration>excalibur-configuration dependency
List of Version of excalibur-configuration>excalibur-configuration dependency
Version of commons-configuration>commons-configuration dependency
List of Version of commons-configuration>commons-configuration dependency
Assigning URL
url to my attendancetemplate.jsp file, please help me if anyone knows, am
problem with dynamic url
" ) #set ( $t_url = "$t_base$t_market... a dynamic url code below to a html template I designed. I am a web designer... it right. Can't figure out why there is a space in the path on the "$t_url
configuration files are used in Struts
configuration files are used in Struts  What configuration files are used in Struts
Configure the configuration file
Configure the configuration file  How do I configure the configuration file
Maven Dependency commons-configuration >> 1.0
You should include the dependency code given in this page to add Maven Dependency of commons-configuration >> commons-configuration version1.0 in your project
Maven Dependency commons-configuration >> 1.0-dev-2.20021231.045254
You should include the dependency code given in this page to add Maven Dependency of commons-configuration >> commons-configuration version1.0-dev-2.20021231.045254 in your project
Maven Dependency commons-configuration >> 1.0-dev-3.20030603.101200
You should include the dependency code given in this page to add Maven Dependency of commons-configuration >> commons-configuration version1.0-dev-3.20030603.101200 in your project
Maven Dependency commons-configuration >> 1.0-dev-3.20030607.194155
You should include the dependency code given in this page to add Maven Dependency of commons-configuration >> commons-configuration version1.0-dev-3.20030607.194155 in your project
Maven Dependency commons-configuration >> 1.0-rc1
You should include the dependency code given in this page to add Maven Dependency of commons-configuration >> commons-configuration version1.0-rc1 in your project
Maven Dependency commons-configuration >> 1.0-rc2
You should include the dependency code given in this page to add Maven Dependency of commons-configuration >> commons-configuration version1.0-rc2 in your project
Maven Dependency commons-configuration >> 1.1
You should include the dependency code given in this page to add Maven Dependency of commons-configuration >> commons-configuration version1.1 in your project
Maven Dependency commons-configuration >> 1.2
You should include the dependency code given in this page to add Maven Dependency of commons-configuration >> commons-configuration version1.2 in your project

Ads