Spark: cluters architecture

In distributed mode, Spark uses a master/slave  architecture with one central  coordinator and many distributed  workers. The central coordinator is called the driver.The driver communicates with a potentially large number of    distributed workers called executors.The driver  runs in its own Java process and each executor is a separate   Java process. A driver and  its executors are together termed a  Spark application.


 

The Driver
  1. Converting a user program into tasks
  2. Scheduling tasks on executors
Executors
  1. run the tasks that make up the application and return results  to the driver
  2. provide in-memory storage for RDDs that are cached by user programs
Cluster Manager

Spark depends on a cluster manager to launch executors and,in certain cases, to launch the driver.The   cluster manager is a pluggable component in Spark.This allows Spark to  run on top of different external managers,such  as YARN and Mesos,as well as its built-in Standalone cluster manager.
Spark can run both drivers and executors on the YARN worker nodes.

 

The procdure of run a spark application

  1. The user submits an application using spark-submit.
  2. spark-submit launches the driver program and invokes the main() method specified by the user.
  3. The driver program contacts the cluster manager to ask for resources to launch executors.
  4. The cluster manager launches executors on behalf of the driver program.
  5. The driver process runs through the user application.Based on the RDD actions and transformations in the program,the driver sends work to executors in the form of tasks.
  6. Tasks are run on executor processes to compute and save results.
  7. If the driver’s main() method exits or it calls SparkContext.stop(),it will terminate the executors and release resources from the cluster manager.

Preferences

<<Learning Spark>>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值