EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login
Home Data Science Data Science Tutorials Spark Tutorial Spark Submit
Secondary Sidebar
Spark Tutorial
  • Basics
    • What is Apache Spark
    • Career in Spark
    • Spark Commands
    • How to Install Spark
    • Spark Versions
    • Apache Spark Architecture
    • Spark Tools
    • Spark Shell Commands
    • Spark Functions
    • RDD in Spark
    • Spark DataFrame
    • Spark Dataset
    • Spark Components
    • Apache Spark (Guide)
    • Spark Stages
    • Spark Streaming
    • Spark Parallelize
    • Spark Transformations
    • Spark Repartition
    • Spark Shuffle
    • Spark Parquet
    • Spark Submit
    • Spark YARN
    • SparkContext
    • Spark Cluster
    • Spark SQL Dataframe
    • Join in Spark SQL
    • What is RDD
    • Spark RDD Operations
    • Spark Broadcast
    • Spark?Executor
    • Spark flatMap
    • Spark Thrift Server
    • Spark Accumulator
    • Spark web UI
    • Spark Interview Questions
  • PySpark
    • PySpark version
    • PySpark Cheat Sheet
    • PySpark list to dataframe
    • PySpark MLlib
    • PySpark RDD
    • PySpark Write CSV
    • PySpark Orderby
    • PySpark Union DataFrame
    • PySpark apply function to column
    • PySpark Count
    • PySpark GroupBy Sum
    • PySpark AGG
    • PySpark Select Columns
    • PySpark withColumn
    • PySpark Median
    • PySpark toDF
    • PySpark partitionBy
    • PySpark join two dataframes
    • PySpark?foreach
    • PySpark when
    • PySPark Groupby
    • PySpark OrderBy Descending
    • PySpark GroupBy Count
    • PySpark Window Functions
    • PySpark Round
    • PySpark substring
    • PySpark Filter
    • PySpark Union
    • PySpark Map
    • PySpark SQL
    • PySpark Histogram
    • PySpark row
    • PySpark rename column
    • PySpark Coalesce
    • PySpark parallelize
    • PySpark read parquet
    • PySpark Join
    • PySpark Left Join
    • PySpark Alias
    • PySpark Column to List
    • PySpark structtype
    • PySpark Broadcast Join
    • PySpark Lag
    • PySpark count distinct
    • PySpark pivot
    • PySpark explode
    • PySpark Repartition
    • PySpark SQL Types
    • PySpark Logistic Regression
    • PySpark mappartitions
    • PySpark collect
    • PySpark Create DataFrame from List
    • PySpark TimeStamp
    • PySpark FlatMap
    • PySpark withColumnRenamed
    • PySpark Sort
    • PySpark to_Date
    • PySpark kmeans
    • PySpark LIKE
    • PySpark?groupby multiple columns

Related Courses

Spark Certification Course

PySpark Certification Course

Apache Storm Course

Spark Submit

By Priya PedamkarPriya Pedamkar

Spark Submit

Introduction to Spark Submit

The Apache Spark Web UI is used in providing necessary information about your application and also understanding how an application is executing on a Hadoop cluster. A suite of web User Interfaces (UI) will be provided by Apache Spark. These will help in monitoring the resource consumption and status of the Spark cluster. The user interface web of Spark Submit gives information regarding – The scheduler stages and tasks list, Environmental information, Memory and RDD size summary, Running executor’s information.
Let us understand all these one by one in detail.

Syntax

The syntax for Apache Spark Submit (How to submit Spark Applications):

spark - submit - option value \ application jar | python file (application arguments)

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

All in One Data Science Bundle(360+ Courses, 50+ projects)
Python TutorialMachine LearningAWSArtificial Intelligence
TableauR ProgrammingPowerBIDeep Learning
Price
View Courses
360+ Online Courses | 50+ projects | 1500+ Hours | Verifiable Certificates | Lifetime Access
4.7 (86,650 ratings)

How Apache Spark Web User Interface Works?

When SparkPi is run on YARN, it demonstrates how to sample applications, packed with Spark and SparkPi run and the value of pi approximation computation is seen.

Use the subscript = spark-submit for submitting an application of a file in Python or a packaged java or a compiled or a Spark JAR.

The command options on Spark Submit are as follows:

Option Description
class the main method is in the fully classified class name for all the scala and java applications.
conf key = value is the format of a spark configuration property. Space containing values have quotes surrounded by them like- “value-keys”
driver-class-path Classpath and configuration entries to pass to the driver. –jars added to JARs, are automatically included in the classpath.
driver-cores Describes the number of cores used in the mode – cluster. 1- default
driver-memory Heap maximum size and is represented as String, for eg – 2g, etc., and allocated to the driver. spark.driver.memory property can also be used instead of
files A list of files is seen separated by commas and are placed in each working directory of executor. The path must be pointing to the local file for client deployment mode. And a local or an URL globally visible file inside the cluster is to be seen in deployment mode.
jars In the classpath of drovers, additional JARs are to be seen and executors in the cluster mode or in the client mode of executor classpath.
master Application run location.
packages The Maven coordinate list is seen, separated by commas of JARs to include on executor and driver classpath. The maven central, local maven, and remote repositories specified in the same are searched in that order.
py-files .py, .zip, .egg files of comma-separated lists to place on PYTHONPATH. The path must be pointed to a local file for the deployment client mode. The path can be pointing to either a globally visible inside your cluster, or a local file, for a cluster deployment mode.
repositories The Maven coordinates specified in packages are searched for a comma-separated list of remote repositories.

Master values:

Master Description
local With no parallelism, run the park in local with one worker thread being one in number.
local [K] With the number of cores set ideally on the host, run the spark locally with k numbered worker threads.
local [*] Take as many local threads as logical cores on the host and run the spark locally.
yarn Use the YARN cluster manager to run this. The location of the cluster I determined by directory for Hadoop configuration – HADOOP_CONF_DIR or the directory for yarn configuration – YARN_CONF_DIR

Example to Implement Spark Submit

Below is the example mentioned:

Example #1

Run the spark-submit application in the spark-submit.sh crit in any of your local shells. The log file list that is generated gives the steps taken by spark-submit.sh script and is located where the script is run. (Try with status parameter running the same below script)

Code:

./spark-submit.sh \
--vcap ./vcap.json \
--deploy-mode cluster \
--conf spark.service.spark_version=2.1 \
--class org.apache.spark.examples.SparkPi \
sparkpi_2.10-1.0.jar

Run the spark-submit application in the spark-submit.sh by using the status parameter. A message finished or failed or error is raised, only then the status stops running or otherwise is queried continuously. ctrl-c can be used to stop running the application or the polling status. Yes is for job cancellation and no is for either to stop polling as a considerable yes or to continue the job running and status polling until finishing the same.

./spark-submit.sh \
--vcap ./vcap.json \
--conf spark.service.spark_version=2.1 \
--status driver-20180117092338-0726-99a44999-f636-46ea-b7f2-b63d530e89e0

Kill parameter is used to cancel the running job by spark-submit.sh application.

./spark-submit.sh \
--vcap ./vcap.json \
--conf spark.service.spark_version=2.1 \
--kill driver-20180117092338-0726-99a44999-f636-46ea-b7f2-b63d530e89e0

Output:

spark Submit1

spark Submit2

Conclusion

We have seen the concept of Apache Spark Submit. Using this makes you overtake a great advantage which is powerful on-demand cloud processing. A cost-effective, fast, and loading the data on your own into an object store in the IBM cloud.

Recommended Articles

This is a guide to Spark Submit. Here we discuss introduction to Spark Submit, syntax, how does it work, examples for better understanding. You can also go through our other related articles to learn more –

  1. What is Apache Spark?
  2. How to Install Spark
  3. Spark Broadcast
  4. Spark Stages
Popular Course in this category
Apache Spark Training (3 Courses)
  3 Online Courses |  13+ Hours |  Verifiable Certificate of Completion |  Lifetime Access
4.5
Price

View Course

Related Courses

PySpark Tutorials (3 Courses)4.9
Apache Storm Training (1 Courses)4.8
0 Shares
Share
Tweet
Share
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Data Science Course

SPSS, Data visualization with Python, Matplotlib Library, Seaborn Package

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more