Four modes of Spark

Source: Internet
Author: User

1.spark mainly has four kinds of operation modes: Loca, standalone, yarn, Mesos.

1) Local mode: On a single machine, typically used for development testing

2) Standalone mode: completely independent spark cluster, not dependent on other clusters, divided into master and work.

The client registers the app with master, the master sends a message to the work, and then starts Driver,executor,driver responsible for sending the task message to executors.

3) Yarn mode: Rely on the Hadoop cluster, yarn Resource scheduling framework, the application submitted to yarn, in applactionmaster (equivalent to stand alone mode master) run driver, scheduling resources on the cluster, Open Excutor to perform the task.

4) Spark on Mesos mode: Similar to yarn mode, runs on the Mesos cluster (Mesos is the open source Distributed resource management framework under Apache, which is known as the kernel of the distributed system. Mesos was originally developed by Amplab of the University of California, Berkeley, and has been widely used in Twitter. )

2. Starting mode: Sparkshell

The Spark-shell is controlled by different parameters to determine which mode to use. Two parameters are involved:

--master master_url         Spark://Host:port, Mesos://host:port, yarn, or Local. --deploy-mode Deploy_mode   Whether to launch the driver program locally ("Client") or on one of the                            worker Mach Ines inside the cluster ("cluster")                            (default:client).

1) Local mode

./spark-shell--master Local./spark-shell--master local[2]  # Local run, two worker threads, ideal for local CPU core number

2) Standalone mode

./spark-shell--master spark://192.168.1.10:7077

3) Yarn Mode

./spark-shell--master Yarn./spark-shell--master yarn-client# does not support this mode #./spark-shell--master yarn-cluster./ Spark-shell--master yarn--deploy-mode client# does not support this mode #./spark-shell--master yarn--deploy-mode Cluster

Spark Job Deployment mode:

Specifies the job deployment mode by using custom parameters when submitting job tasks by starting Spark-submit form.

eg

Client mode
Spark-submit--master yarn--deploy-mode client--class xxx--executor-memory 1g--executor-cores 2--num-executors 4 xxx. Jar 1000

------------------------

1.client

The driver program runs on the client side.

2.cluster

The driver program runs on a worker.

Note: Spark-shell can only be started in client mode.

  

Four modes of Spark

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.