欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Spark Standalone Mode下的client mode和cluster mode

程序员文章站 2022-05-19 13:45:19
...

 1 . 有问题找百度,百度上搜索spark

Spark Standalone Mode下的client mode和cluster mode

2. 进入spark官网,找到对应的版本的文档.因为我的是spark2.1.2版本

Spark Standalone Mode下的client mode和cluster mode

Spark Standalone Mode下的client mode和cluster mode

3.进入spark的2.1.2文档后,看到Running the Examples and Shell和Launching on a Cluster

Launching on a Cluster

The Spark cluster mode overview explains the key concepts in running on a cluster. Spark can run both by itself, or over several existing cluster managers. It currently provides several options for deployment:

Spark Standalone Mode下的client mode和cluster mode

4.进入文档的Spark Standalone Mode页面

Spark Standalone Mode下的client mode和cluster mode

5.Launching Spark Applications目录下讲了client modecluster mode

Launching Spark Applications

The spark-submit script provides the most straightforward way to submit a compiled Spark application to the cluster. For standalone clusters, Spark currently supports two deploy modes. In client mode, the driver is launched in the same process as the client that submits the application(自己注释:client driver在同一个 process). In cluster mode, however, the driver is launched from one of the Worker processes inside the cluster, and the client process exits as soon as it fulfills its responsibility of submitting the application without waiting for the application to finish(自己注释:driver 由Worker 启动,client 很快退出).

If your application is launched through Spark submit, then the application jar is automatically distributed to all worker nodes. For any additional jars that your application depends on, you should specify them through the --jars flag using comma as a delimiter (e.g. --jars jar1,jar2). To control the application’s configuration or execution environment, see Spark Configuration.

Additionally, standalone cluster mode supports restarting your application automatically if it exited with non-zero exit code. To use this feature, you may pass in the --supervise flag to spark-submit when launching your application. Then, if you wish to kill an application that is failing repeatedly, you may do so through:

./bin/spark-class org.apache.spark.deploy.Client kill <master url> <driver ID>

You can find the driver ID through the standalone Master web UI at http://<master url>:8080.

Spark Standalone Mode下的client mode和cluster mode