Spark运行模式:cluster与client

When run SparkSubmit --class [mainClass], SparkSubmit will call a childMainClass which is

1. client mode, childMainClass = mainClass

2. standalone cluster mde, childMainClass = org.apache.spark.deploy.Client

3. yarn cluster mode, childMainClass = org.apache.spark.deploy.yarn.Client

The childMainClass is a wrapper of mainClass. The childMainClass will be called in SparkSubmit, and if cluster mode, the childMainClass will talk to the the cluster and launch a process on one woker to run the mainClass.

ps. use "spark-submit -v" to print debug infos.

Yarn client: spark-submit -v --class "org.apache.spark.examples.JavaWordCount" --master yarn JavaWordCount.jar

childMainclass: org.apache.spark.examples.JavaWordCount

Yarn cluster: spark-submit -v --class "org.apache.spark.examples.JavaWordCount" --master yarn-cluster JavaWordCount.jar

childMainclass: org.apache.spark.deploy.yarn.Client

Standalone client: spark-submit -v --class "org.apache.spark.examples.JavaWordCount" --master spark://aa01:7077 JavaWordCount.jar

childMainclass: org.apache.spark.examples.JavaWordCount

Stanalone cluster: spark-submit -v --class "org.apache.spark.examples.JavaWordCount" --master spark://aa01:7077 --deploy-mode cluster JavaWordCount.jar

childMainclass: org.apache.spark.deploy.rest.RestSubmissionClient (if rest, else org.apache.spark.deploy.Client)

Taking standalone spark as example, here is the client mode workflow. The mainclass run in the driver application which could be reside out of the cluster.

时间: 2024-08-11 01:36:01

Spark运行模式:cluster与client的相关文章

理解Spark运行模式(二)(Yarn Cluster)

上一篇说到Spark的yarn client运行模式,它与yarn cluster模式的主要区别就是前者Driver是运行在客户端,后者Driver是运行在yarn集群中.yarn client模式一般用在交互式场景中,比如spark shell, spark sql等程序,但是该模式下运行在客户端的Driver与Yarn集群有大量的网络交互,如果客户端与集群之间的网络不是很好,可能会导致性能问题.因此一般在生产环境中,大部分还是采用yarn cluster模式运行spark程序. 下面具体还是

(2)spark运行模式

spark运行模式 下面我们来看一下spark的运行模式,根据上一篇博客我们知道spark的运行模式分为以下几种:local.standalone.hadoop yarn.我们说本地开发最好用local模式,直接搭建一个spark环境就可以跑了,因为测试的话本地是最方便的.standalone,用的比较少.hadoop yarn,这个是用的最多的,用spark的公司至少有70%是用yarn这个模式的.yarn是一个资源管理器,我们后面会说.下面我们就来讲解这几种运行模式. local运行模式 这

Spark运行模式_spark自带cluster manager的standalone cluster模式(集群)

这种运行模式和"Spark自带Cluster Manager的Standalone Client模式(集群)"还是有很大的区别的.使用如下命令执行应用程序(前提是已经启动了spark的Master.Worker守护进程)不用启动Hadoop服务,除非你用到了HDFS的内容. 各节点启动的JVM进程情况如下: master节点上的进程 提交应用程序的客户端上的进程 某worker节点上的进程 客户端的SparkSubmit进程会在应用程序提交给集群之后就退出(区别1) Master会在集

3.spark运行模式

spark支持的运行模式:本地模式.本地集群模式.standalone模式.yarn模式及mesos模式. 本地模式 local.local[N]或local[N,maxRetries].主要用于代码调试和跟踪.不具备容错能力,不适用于生产环境. 本地模式只有Driver,没有Master和Worker.执行任务的Executor与Driver在同一个JVM进程中. 本地集群模式 local-cluster[N,cores,memory].也主要用于代码调试和测试,是源码学习常用的模式.不具备容

spark运行模式

Spark有以下四种运行模式: local:本地单进程模式,用于本地开发测试Spark代码; standalone:分布式集群模式,Master-Worker架构,Master负责调度,Worker负责具体Task的执行; on yarn/mesos:运行在yarn/mesos等资源管理框架之上,yarn/mesos提供资源管理,spark提供计算调度,并可与其他计算框架(如MapReduce/MPI/Storm)共同运行在同一个集群之上; on cloud(EC2):运行在AWS的EC2之上

Spark运行模式_基于YARN的Resource Manager的Custer模式(集群)

使用如下命令执行应用程序: 和"基于YARN的Resource Manager的Client模式(集群)"运行模式,区别如下: 在Resource Manager端提交应用程序,会生成SparkSubmit进程,该进程只用来做Client端,应用程序提交给集群后,就会删除该进程. Resource Manager在集群中的某个NodeManager上运行ApplicationMaster,该AM同时会执行driver程序.紧接着,会在各NodeManager上运行CoarseGrain

Spark运行模式_基于YARN的Resource Manager的Client模式(集群)

现在越来越多的场景,都是Spark跑在Hadoop集群中,所以为了做到资源能够均衡调度,会使用YARN来做为Spark的Cluster Manager,来为Spark的应用程序分配资源. 在执行Spark应用程序前,要启动Hadoop的各种服务.由于已经有了资源管理器,所以不需要启动Spark的Master.Worker守护进程.相关配置的修改,请自行研究. 使用如下命令执行应用程序 提交应用程序后,各节点会启动相关的JVM进程,如下: 在Resource Manager节点上提交应用程序,会生

Spark运行模式概述

Spark编程模型的回顾 spark编程模型几大要素 RDD的五大特征 Application program的组成 运行流程概述 具体流程(以standalone模式为例) 任务调度 DAGScheduler

spark学习(基础篇)--(第三节)Spark几种运行模式

h2 { color: #fff; background-color: #7CCD7C; padding: 3px; margin: 10px 0px } h3 { color: #fff; background-color: #008eb7; padding: 3px; margin: 10px 0px } spark应用执行机制分析 前段时间一直在编写指标代码,一直采用的是--deploy-mode client方式开发测试,因此执行没遇到什么问题,但是放到生产上采用--master yar