Spark Application提交运行时部署模式Deploy Mode,==表示的是Driver Program运行的地方,要么是提交应用的Client:client,要么是集群中从节点(Standalone:Worker,YARN: NodeManager):cluster。
--deploy-mode DEPLOY_MODE
Whether to launch the driver program locally ("client") or on one of the worker machines inside the cluster ("cluster")(Default: client).
默认值为client,当时在实际项目中,尤其在生产环境,使用cluster部署模式提交应用运行。
1. 两种模式区别
Cluster和Client模式最最本质的区别是:Driver程序运行在哪里。
1.1 client 模式
此种模式:
1)Driver 在本地运行
2)Executor 在集群的Worker节点上运行
以Spark Application运行到Standalone集群上为例,前面提交运行圆周率PI或者词频统计 WordCount程序时,默认DeployMode为Client,表示应用Driver Program运行在提交应用Client 主机上(启动JVM Process进程),示意图如下: