-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-9570][Docs][YARN]Consistent recommendation for submitting spark apps to YARN, -master yarn --deploy-mode x vs -master yarn-x' #8071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
00b655c
d285212
0fe6674
40ed2af
fe2fb7f
c4fd2a2
853809e
3c9802d
071bbad
91e9389
0f90d60
55752d8
600031e
d378396
dfe347d
bce7279
8cad854
dbd778d
5b8bb1b
5831294
520ad44
2a3be4d
00c0272
f16bc68
423cdfd
be3e271
017b5de
736af95
5a5bbc2
afa757c
b8fdd5c
8c65676
ca8f70e
3ef0f32
74a293f
c3e9a12
b1581ac
b85f9a2
a807fcb
4e3f4b9
bab8923
5c99d8b
741a29f
9d08224
3ecb379
2e68066
be5d191
66d87c1
e011079
57ec27d
70fe558
60103ec
762bacc
8a331d0
551def5
6f60298
a17384f
738f353
ab7e721
7035d88
caa14d9
6e409bc
e6aef55
fc1c7fd
660e6dc
8ce6096
0d1d146
f4bc01f
7b13ed2
7c35746
4413d08
d2d5e7f
d7053be
2fb4901
2278219
a8ab263
5fc058a
df54389
d7eb371
d0b1891
68f9957
84a2791
6993031
2932e25
7a539ef
4b70798
65fec79
8815ba2
864de8e
a8d2f4c
c2520f5
0fed23b
6c5858b
693949b
c50f97d
8187b3a
bd35385
7c7c752
c8677d7
a0e1abb
7ecf0c4
a7317cc
34d610b
57c2d08
3bc5528
ece0056
ffa05c8
33bae58
6518ef6
9407baa
11ed2b1
2a6590e
1150a19
f3bfb71
18a761e
932b24f
e5fd604
37586e5
ec29f20
6c4fdbe
609ce3c
71a3af8
7c1e568
a85fb6c
5705672
1db7179
182f9b7
5f9ce73
cf01607
ae2370e
26e7605
3ff81ad
f7efda3
76c155d
ed092a0
f68d024
a4acdab
f10660f
b265e28
772e7c1
fdaf17f
088b11e
52ae952
0076e82
18523c1
0b6b017
f9d1a92
c90c605
ee093c8
e290029
a091031
5af3838
dd0614f
c34e9ff
5723d26
1968276
354f458
c1840a8
f5ea391
f4fa61e
747c2ba
8bae901
bf1d661
80cb25b
9b731fa
fa41e02
492ac1f
1dbffba
c635a16
9108eff
badf7fa
04e0fea
1f89029
b4b35f1
1aeae05
90273ef
a5b5b93
bf32c1f
270ee67
1ff0580
de32238
1c843e2
010b03e
bc9a0e0
b23c4d3
f141efe
865a3df
ba2a07e
3d16a54
39e4ebd
802b5b8
f3e1779
2fcb9cb
5fd53c6
28a9846
d898c33
5b62bef
f3391ff
e05da5c
0888736
21bdbe9
1f4c4fe
f3ff4c4
373a376
e0dd130
b0dbaec
8e0a072
ba5f7e1
2f2686a
1f29d50
affc8a8
73431d8
b762f99
43e0135
b4f4e91
52c6053
39e91fe
85f9a61
12de348
907df2f
2a3d98a
7cfc075
eaafe13
afe9f03
cdd9a2b
dcfe0c5
bb220f6
708036c
3c462f5
d89cc38
f5b028e
e335509
f01c422
630a994
46fcb9e
90cb9f0
623c675
670d251
40d3b80
89d15bf
d2c212a
3f25500
0766da6
46a24d5
9175807
3052c74
c91073e
3dc79e2
67a4255
a8b67ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,6 +48,44 @@ Some of the commonly used options are: | |
| * `application-jar`: Path to a bundled jar including your application and all dependencies. The URL must be globally visible inside of your cluster, for instance, an `hdfs://` path or a `file://` path that is present on all nodes. | ||
| * `application-arguments`: Arguments passed to the main method of your main class, if any | ||
|
|
||
| Alternatively, for submitting on yarn, | ||
|
|
||
| {% highlight bash %} | ||
| ./bin/spark-submit \ | ||
| --class <main-class> | ||
| --master <yarn-deploy-mode> | ||
| --conf <key>=<value> \ | ||
| ... # other options | ||
| <application-jar> \ | ||
| [application-arguments] | ||
| {% endhighlight %} | ||
|
|
||
| * `--master`: The --master parameter is either `yarn-client` or `yarn-cluster`. Defaults to `yarn-client` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually I would rather see us use the --deploy-mode option to choose cluster vs client and --master yarn. Unless something has changed we kept yarn-cluster and yarn-client around just for backwards compatibility.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @srowen and @tgravescs, users still have the confusion regarding the "recommended/preferred" method of submission.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it makes sense to promote both ways. I also think both have to be retained for compatibility. I'm still not clear what people think the usual way to do it is; I've always seen and used
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree we should have a preferred method and update docs to match. I think the existing docs just never were fully updated. There wouldn't be a reason to have the --deploy-mode if we used yarn-client/yarn-cluster. There was discussion about it back then. cc @sryza
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will grep the docs to see the more popular approach to submission amongst the two. |
||
|
|
||
| # Master URLs | ||
|
|
||
| The master URL passed to Spark can be in one of the following formats: | ||
|
|
||
| <table class="table"> | ||
| <tr><th>Master URL</th><th>Meaning</th></tr> | ||
| <tr><td> local </td><td> Run Spark locally with one worker thread (i.e. no parallelism at all). </td></tr> | ||
| <tr><td> local[K] </td><td> Run Spark locally with K worker threads (ideally, set this to the number of cores on your machine). </td></tr> | ||
| <tr><td> local[*] </td><td> Run Spark locally with as many worker threads as logical cores on your machine.</td></tr> | ||
| <tr><td> spark://HOST:PORT </td><td> Connect to the given <a href="spark-standalone.html">Spark standalone | ||
| cluster</a> master. The port must be whichever one your master is configured to use, which is 7077 by default. | ||
| </td></tr> | ||
| <tr><td> mesos://HOST:PORT </td><td> Connect to the given <a href="running-on-mesos.html">Mesos</a> cluster. | ||
| The port must be whichever one your is configured to use, which is 5050 by default. | ||
| Or, for a Mesos cluster using ZooKeeper, use <code>mesos://zk://...</code>. | ||
| </td></tr> | ||
| <tr><td> yarn-client </td><td> Connect to a <a href="running-on-yarn.html"> YARN </a> cluster in | ||
| client mode. The cluster location will be found based on the HADOOP_CONF_DIR or YARN_CONF_DIR variable. | ||
| </td></tr> | ||
| <tr><td> yarn-cluster </td><td> Connect to a <a href="running-on-yarn.html"> YARN </a> cluster in | ||
| cluster mode. The cluster location will be found based on the HADOOP_CONF_DIR or YARN_CONF_DIR variable. | ||
| </td></tr> | ||
| </table> | ||
|
|
||
| <b>†</b> A common deployment strategy is to submit your application from a gateway machine | ||
| that is | ||
| physically co-located with your worker machines (e.g. Master node in a standalone EC2 cluster). | ||
|
|
@@ -99,7 +137,7 @@ run it with `--help`. Here are a few examples of common options: | |
| /path/to/examples.jar \ | ||
| 1000 | ||
|
|
||
| # Run on a YARN cluster | ||
| # Run on a YARN cluster without --deploy mode | ||
| export HADOOP_CONF_DIR=XXX | ||
| ./bin/spark-submit \ | ||
| --class org.apache.spark.examples.SparkPi \ | ||
|
|
@@ -116,31 +154,6 @@ export HADOOP_CONF_DIR=XXX | |
| 1000 | ||
| {% endhighlight %} | ||
|
|
||
| # Master URLs | ||
|
|
||
| The master URL passed to Spark can be in one of the following formats: | ||
|
|
||
| <table class="table"> | ||
| <tr><th>Master URL</th><th>Meaning</th></tr> | ||
| <tr><td> local </td><td> Run Spark locally with one worker thread (i.e. no parallelism at all). </td></tr> | ||
| <tr><td> local[K] </td><td> Run Spark locally with K worker threads (ideally, set this to the number of cores on your machine). </td></tr> | ||
| <tr><td> local[*] </td><td> Run Spark locally with as many worker threads as logical cores on your machine.</td></tr> | ||
| <tr><td> spark://HOST:PORT </td><td> Connect to the given <a href="spark-standalone.html">Spark standalone | ||
| cluster</a> master. The port must be whichever one your master is configured to use, which is 7077 by default. | ||
| </td></tr> | ||
| <tr><td> mesos://HOST:PORT </td><td> Connect to the given <a href="running-on-mesos.html">Mesos</a> cluster. | ||
| The port must be whichever one your is configured to use, which is 5050 by default. | ||
| Or, for a Mesos cluster using ZooKeeper, use <code>mesos://zk://...</code>. | ||
| </td></tr> | ||
| <tr><td> yarn-client </td><td> Connect to a <a href="running-on-yarn.html"> YARN </a> cluster in | ||
| client mode. The cluster location will be found based on the HADOOP_CONF_DIR or YARN_CONF_DIR variable. | ||
| </td></tr> | ||
| <tr><td> yarn-cluster </td><td> Connect to a <a href="running-on-yarn.html"> YARN </a> cluster in | ||
| cluster mode. The cluster location will be found based on the HADOOP_CONF_DIR or YARN_CONF_DIR variable. | ||
| </td></tr> | ||
| </table> | ||
|
|
||
|
|
||
| # Loading Configuration from a File | ||
|
|
||
| The `spark-submit` script can load default [Spark configuration values](configuration.html) from a | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yarn -> YARN
I don't know if this helps as it's just presenting both ways to set this, and not clarifying which is preferred. It also duplicates the rest of the example.