# Running Modes

Plz see Ch 10 and ch11 from spark in action book for more detailed discussion

When running in cluster mode, the driver runs on ApplicationMaster, the component that submits YARN container requests to the YARN ResourceManager according to the resources needed by the application. A simplified and high-level diagram of the application submission process is shown below.

![](https://3957382301-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LsbZSfH3V7-1Ycuzu80%2F-LsbZZL4J3VRHnXA0HfC%2F-LsbZ_IvKOhxlR_KxGD7%2Fmode1.png?generation=1572621933330846\&alt=media)

When running in client mode, the driver runs outside ApplicationMaster, in the\_spark-submit\_script process from the machine used to submit the application.

![](https://3957382301-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LsbZSfH3V7-1Ycuzu80%2F-LsbZZL4J3VRHnXA0HfC%2F-LsbZ_IxKfJFrVuvSaGT%2Fmode2.png?generation=1572621934493520\&alt=media)

![](https://3957382301-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LsbZSfH3V7-1Ycuzu80%2F-LsbZZL4J3VRHnXA0HfC%2F-LsbZ_IzMPwI1vbo9Y34%2Frunning.png?generation=1572621934112413\&alt=media)

![](https://3957382301-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LsbZSfH3V7-1Ycuzu80%2F-LsbZZL4J3VRHnXA0HfC%2F-LsbZ_J0DOQMBoC3TBbs%2Frm1.png?generation=1572621933284033\&alt=media)

![](https://3957382301-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LsbZSfH3V7-1Ycuzu80%2F-LsbZZL4J3VRHnXA0HfC%2F-LsbZ_J2tO6NSDleo8xl%2Frm2.png?generation=1572621934038844\&alt=media)

![](https://3957382301-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LsbZSfH3V7-1Ycuzu80%2F-LsbZZL4J3VRHnXA0HfC%2F-LsbZ_J4p75z_pLKa4HW%2Flm.png?generation=1572621937513646\&alt=media)

![](https://3957382301-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LsbZSfH3V7-1Ycuzu80%2F-LsbZZL4J3VRHnXA0HfC%2F-LsbZ_J6iJhW1UU1VyE7%2Fsm.png?generation=1572621933714484\&alt=media)

![](https://3957382301-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LsbZSfH3V7-1Ycuzu80%2F-LsbZZL4J3VRHnXA0HfC%2F-LsbZ_J8kA5L4QhlTOnp%2Fsm1.png?generation=1572621934440421\&alt=media)

![](https://3957382301-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LsbZSfH3V7-1Ycuzu80%2F-LsbZZL4J3VRHnXA0HfC%2F-LsbZ_JAI-_ROgaK5UpW%2Fym.png?generation=1572621933726070\&alt=media)

## Master URLs <a href="#master-urls" id="master-urls"></a>

[http://spark.apache.org/docs/latest/submitting-applications.html](http://spark.apache.org/docs/latest/submitting-applications.html)

![](https://3957382301-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LsbZSfH3V7-1Ycuzu80%2F-LsbZZL4J3VRHnXA0HfC%2F-LsbZ_JCpHUyuNAY0dZn%2Fmaster1.png?generation=1572621933651772\&alt=media)

![](https://3957382301-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LsbZSfH3V7-1Ycuzu80%2F-LsbZZL4J3VRHnXA0HfC%2F-LsbZ_JEZhLsGsRKaq5J%2FrunM1.png?generation=1572621934699699\&alt=media)

[http://spark.apache.org/docs/latest/submitting-applications.html](http://spark.apache.org/docs/latest/submitting-applications.html)

![](https://3957382301-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LsbZSfH3V7-1Ycuzu80%2F-LsbZZL4J3VRHnXA0HfC%2F-LsbZ_JGLq0X5RSpriLm%2Frm5.png?generation=1572621933318532\&alt=media)
