1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
|
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Configuration - Spark 1.5.2 Documentation</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<style>
body {
padding-top: 60px;
padding-bottom: 40px;
}
</style>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/bootstrap-responsive.min.css">
<link rel="stylesheet" href="css/main.css">
<script src="js/vendor/modernizr-2.6.1-respond-1.1.0.min.js"></script>
<link rel="stylesheet" href="css/pygments-default.css">
<!-- Google analytics script -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-32518208-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<!--[if lt IE 7]>
<p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience this site.</p>
<![endif]-->
<!-- This code is taken from http://twitter.github.com/bootstrap/examples/hero.html -->
<div class="navbar navbar-fixed-top" id="topbar">
<div class="navbar-inner">
<div class="container">
<div class="brand"><a href="index.html">
<img src="img/spark-logo-hd.png" style="height:50px;"/></a><span class="version">1.5.2</span>
</div>
<ul class="nav">
<!--TODO(andyk): Add class="active" attribute to li some how.-->
<li><a href="index.html">Overview</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Programming Guides<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="quick-start.html">Quick Start</a></li>
<li><a href="programming-guide.html">Spark Programming Guide</a></li>
<li class="divider"></li>
<li><a href="streaming-programming-guide.html">Spark Streaming</a></li>
<li><a href="sql-programming-guide.html">DataFrames and SQL</a></li>
<li><a href="mllib-guide.html">MLlib (Machine Learning)</a></li>
<li><a href="graphx-programming-guide.html">GraphX (Graph Processing)</a></li>
<li><a href="bagel-programming-guide.html">Bagel (Pregel on Spark)</a></li>
<li><a href="sparkr.html">SparkR (R on Spark)</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">API Docs<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="api/scala/index.html#org.apache.spark.package">Scala</a></li>
<li><a href="api/java/index.html">Java</a></li>
<li><a href="api/python/index.html">Python</a></li>
<li><a href="api/R/index.html">R</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Deploying<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="cluster-overview.html">Overview</a></li>
<li><a href="submitting-applications.html">Submitting Applications</a></li>
<li class="divider"></li>
<li><a href="spark-standalone.html">Spark Standalone</a></li>
<li><a href="running-on-mesos.html">Mesos</a></li>
<li><a href="running-on-yarn.html">YARN</a></li>
<li class="divider"></li>
<li><a href="ec2-scripts.html">Amazon EC2</a></li>
</ul>
</li>
<li class="dropdown">
<a href="api.html" class="dropdown-toggle" data-toggle="dropdown">More<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="configuration.html">Configuration</a></li>
<li><a href="monitoring.html">Monitoring</a></li>
<li><a href="tuning.html">Tuning Guide</a></li>
<li><a href="job-scheduling.html">Job Scheduling</a></li>
<li><a href="security.html">Security</a></li>
<li><a href="hardware-provisioning.html">Hardware Provisioning</a></li>
<li><a href="hadoop-third-party-distributions.html">3<sup>rd</sup>-Party Hadoop Distros</a></li>
<li class="divider"></li>
<li><a href="building-spark.html">Building Spark</a></li>
<li><a href="https://cwiki.apache.org/confluence/display/SPARK/Contributing+to+Spark">Contributing to Spark</a></li>
<li><a href="https://cwiki.apache.org/confluence/display/SPARK/Supplemental+Spark+Projects">Supplemental Projects</a></li>
</ul>
</li>
</ul>
<!--<p class="navbar-text pull-right"><span class="version-text">v1.5.2</span></p>-->
</div>
</div>
</div>
<div class="container" id="content">
<h1 class="title">Spark Configuration</h1>
<ul id="markdown-toc">
<li><a href="#spark-properties" id="markdown-toc-spark-properties">Spark Properties</a> <ul>
<li><a href="#dynamically-loading-spark-properties" id="markdown-toc-dynamically-loading-spark-properties">Dynamically Loading Spark Properties</a></li>
<li><a href="#viewing-spark-properties" id="markdown-toc-viewing-spark-properties">Viewing Spark Properties</a></li>
<li><a href="#available-properties" id="markdown-toc-available-properties">Available Properties</a> <ul>
<li><a href="#application-properties" id="markdown-toc-application-properties">Application Properties</a></li>
<li><a href="#runtime-environment" id="markdown-toc-runtime-environment">Runtime Environment</a></li>
<li><a href="#shuffle-behavior" id="markdown-toc-shuffle-behavior">Shuffle Behavior</a></li>
<li><a href="#spark-ui" id="markdown-toc-spark-ui">Spark UI</a></li>
<li><a href="#compression-and-serialization" id="markdown-toc-compression-and-serialization">Compression and Serialization</a></li>
<li><a href="#execution-behavior" id="markdown-toc-execution-behavior">Execution Behavior</a></li>
<li><a href="#networking" id="markdown-toc-networking">Networking</a></li>
<li><a href="#scheduling" id="markdown-toc-scheduling">Scheduling</a></li>
<li><a href="#dynamic-allocation" id="markdown-toc-dynamic-allocation">Dynamic Allocation</a></li>
<li><a href="#security" id="markdown-toc-security">Security</a></li>
<li><a href="#encryption" id="markdown-toc-encryption">Encryption</a></li>
<li><a href="#spark-streaming" id="markdown-toc-spark-streaming">Spark Streaming</a></li>
<li><a href="#sparkr" id="markdown-toc-sparkr">SparkR</a></li>
<li><a href="#cluster-managers" id="markdown-toc-cluster-managers">Cluster Managers</a> <ul>
<li><a href="#yarnrunning-on-yarnhtmlconfiguration" id="markdown-toc-yarnrunning-on-yarnhtmlconfiguration"><a href="running-on-yarn.html#configuration">YARN</a></a></li>
<li><a href="#mesosrunning-on-mesoshtmlconfiguration" id="markdown-toc-mesosrunning-on-mesoshtmlconfiguration"><a href="running-on-mesos.html#configuration">Mesos</a></a></li>
<li><a href="#standalone-modespark-standalonehtmlcluster-launch-scripts" id="markdown-toc-standalone-modespark-standalonehtmlcluster-launch-scripts"><a href="spark-standalone.html#cluster-launch-scripts">Standalone Mode</a></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><a href="#environment-variables" id="markdown-toc-environment-variables">Environment Variables</a></li>
<li><a href="#configuring-logging" id="markdown-toc-configuring-logging">Configuring Logging</a></li>
<li><a href="#overriding-configuration-directory" id="markdown-toc-overriding-configuration-directory">Overriding configuration directory</a></li>
</ul>
<p>Spark provides three locations to configure the system:</p>
<ul>
<li><a href="#spark-properties">Spark properties</a> control most application parameters and can be set by using
a <a href="api/scala/index.html#org.apache.spark.SparkConf">SparkConf</a> object, or through Java
system properties.</li>
<li><a href="#environment-variables">Environment variables</a> can be used to set per-machine settings, such as
the IP address, through the <code>conf/spark-env.sh</code> script on each node.</li>
<li><a href="#configuring-logging">Logging</a> can be configured through <code>log4j.properties</code>.</li>
</ul>
<h1 id="spark-properties">Spark Properties</h1>
<p>Spark properties control most application settings and are configured separately for each
application. These properties can be set directly on a
<a href="api/scala/index.html#org.apache.spark.SparkConf">SparkConf</a> passed to your
<code>SparkContext</code>. <code>SparkConf</code> allows you to configure some of the common properties
(e.g. master URL and application name), as well as arbitrary key-value pairs through the
<code>set()</code> method. For example, we could initialize an application with two threads as follows:</p>
<p>Note that we run with local[2], meaning two threads - which represents “minimal” parallelism,
which can help detect bugs that only exist when we run in a distributed context.</p>
<div class="highlight"><pre><code class="language-scala" data-lang="scala"><span class="k">val</span> <span class="n">conf</span> <span class="k">=</span> <span class="k">new</span> <span class="nc">SparkConf</span><span class="o">()</span>
<span class="o">.</span><span class="n">setMaster</span><span class="o">(</span><span class="s">"local[2]"</span><span class="o">)</span>
<span class="o">.</span><span class="n">setAppName</span><span class="o">(</span><span class="s">"CountingSheep"</span><span class="o">)</span>
<span class="k">val</span> <span class="n">sc</span> <span class="k">=</span> <span class="k">new</span> <span class="nc">SparkContext</span><span class="o">(</span><span class="n">conf</span><span class="o">)</span></code></pre></div>
<p>Note that we can have more than 1 thread in local mode, and in cases like Spark Streaming, we may
actually require one to prevent any sort of starvation issues.</p>
<p>Properties that specify some time duration should be configured with a unit of time.
The following format is accepted:</p>
<pre><code>25ms (milliseconds)
5s (seconds)
10m or 10min (minutes)
3h (hours)
5d (days)
1y (years)
</code></pre>
<p>Properties that specify a byte size should be configured with a unit of size.<br />
The following format is accepted:</p>
<pre><code>1b (bytes)
1k or 1kb (kibibytes = 1024 bytes)
1m or 1mb (mebibytes = 1024 kibibytes)
1g or 1gb (gibibytes = 1024 mebibytes)
1t or 1tb (tebibytes = 1024 gibibytes)
1p or 1pb (pebibytes = 1024 tebibytes)
</code></pre>
<h2 id="dynamically-loading-spark-properties">Dynamically Loading Spark Properties</h2>
<p>In some cases, you may want to avoid hard-coding certain configurations in a <code>SparkConf</code>. For
instance, if you’d like to run the same application with different masters or different
amounts of memory. Spark allows you to simply create an empty conf:</p>
<div class="highlight"><pre><code class="language-scala" data-lang="scala"><span class="k">val</span> <span class="n">sc</span> <span class="k">=</span> <span class="k">new</span> <span class="nc">SparkContext</span><span class="o">(</span><span class="k">new</span> <span class="nc">SparkConf</span><span class="o">())</span></code></pre></div>
<p>Then, you can supply configuration values at runtime:</p>
<div class="highlight"><pre><code class="language-bash" data-lang="bash">./bin/spark-submit --name <span class="s2">"My app"</span> --master <span class="nb">local</span><span class="o">[</span>4<span class="o">]</span> --conf spark.shuffle.spill<span class="o">=</span><span class="nb">false</span>
--conf <span class="s2">"spark.executor.extraJavaOptions=-XX:+PrintGCDetails -XX:+PrintGCTimeStamps"</span> myApp.jar</code></pre></div>
<p>The Spark shell and <a href="submitting-applications.html"><code>spark-submit</code></a>
tool support two ways to load configurations dynamically. The first are command line options,
such as <code>--master</code>, as shown above. <code>spark-submit</code> can accept any Spark property using the <code>--conf</code>
flag, but uses special flags for properties that play a part in launching the Spark application.
Running <code>./bin/spark-submit --help</code> will show the entire list of these options.</p>
<p><code>bin/spark-submit</code> will also read configuration options from <code>conf/spark-defaults.conf</code>, in which
each line consists of a key and a value separated by whitespace. For example:</p>
<pre><code>spark.master spark://5.6.7.8:7077
spark.executor.memory 4g
spark.eventLog.enabled true
spark.serializer org.apache.spark.serializer.KryoSerializer
</code></pre>
<p>Any values specified as flags or in the properties file will be passed on to the application
and merged with those specified through SparkConf. Properties set directly on the SparkConf
take highest precedence, then flags passed to <code>spark-submit</code> or <code>spark-shell</code>, then options
in the <code>spark-defaults.conf</code> file. A few configuration keys have been renamed since earlier
versions of Spark; in such cases, the older key names are still accepted, but take lower
precedence than any instance of the newer key.</p>
<h2 id="viewing-spark-properties">Viewing Spark Properties</h2>
<p>The application web UI at <code>http://<driver>:4040</code> lists Spark properties in the “Environment” tab.
This is a useful place to check to make sure that your properties have been set correctly. Note
that only values explicitly specified through <code>spark-defaults.conf</code>, <code>SparkConf</code>, or the command
line will appear. For all other configuration properties, you can assume the default value is used.</p>
<h2 id="available-properties">Available Properties</h2>
<p>Most of the properties that control internal settings have reasonable default values. Some
of the most common options to set are:</p>
<h4 id="application-properties">Application Properties</h4>
<table class="table">
<tr><th>Property Name</th><th>Default</th><th>Meaning</th></tr>
<tr>
<td><code>spark.app.name</code></td>
<td>(none)</td>
<td>
The name of your application. This will appear in the UI and in log data.
</td>
</tr>
<tr>
<td><code>spark.driver.cores</code></td>
<td>1</td>
<td>
Number of cores to use for the driver process, only in cluster mode.
</td>
</tr>
<td><code>spark.driver.maxResultSize</code></td>
<td>1g</td>
<td>
Limit of total size of serialized results of all partitions for each Spark action (e.g. collect).
Should be at least 1M, or 0 for unlimited. Jobs will be aborted if the total size
is above this limit.
Having a high limit may cause out-of-memory errors in driver (depends on spark.driver.memory
and memory overhead of objects in JVM). Setting a proper limit can protect the driver from
out-of-memory errors.
</td>
<tr>
<td><code>spark.driver.memory</code></td>
<td>1g</td>
<td>
Amount of memory to use for the driver process, i.e. where SparkContext is initialized.
(e.g. <code>1g</code>, <code>2g</code>).
<br /><em>Note:</em> In client mode, this config must not be set through the <code>SparkConf</code>
directly in your application, because the driver JVM has already started at that point.
Instead, please set this through the <code>--driver-memory</code> command line option
or in your default properties file.
</td>
</tr>
<tr>
<td><code>spark.executor.memory</code></td>
<td>1g</td>
<td>
Amount of memory to use per executor process (e.g. <code>2g</code>, <code>8g</code>).
</td>
</tr>
<tr>
<td><code>spark.extraListeners</code></td>
<td>(none)</td>
<td>
A comma-separated list of classes that implement <code>SparkListener</code>; when initializing
SparkContext, instances of these classes will be created and registered with Spark's listener
bus. If a class has a single-argument constructor that accepts a SparkConf, that constructor
will be called; otherwise, a zero-argument constructor will be called. If no valid constructor
can be found, the SparkContext creation will fail with an exception.
</td>
</tr>
<tr>
<td><code>spark.local.dir</code></td>
<td>/tmp</td>
<td>
Directory to use for "scratch" space in Spark, including map output files and RDDs that get
stored on disk. This should be on a fast, local disk in your system. It can also be a
comma-separated list of multiple directories on different disks.
NOTE: In Spark 1.0 and later this will be overriden by SPARK_LOCAL_DIRS (Standalone, Mesos) or
LOCAL_DIRS (YARN) environment variables set by the cluster manager.
</td>
</tr>
<tr>
<td><code>spark.logConf</code></td>
<td>false</td>
<td>
Logs the effective SparkConf as INFO when a SparkContext is started.
</td>
</tr>
<tr>
<td><code>spark.master</code></td>
<td>(none)</td>
<td>
The cluster manager to connect to. See the list of
<a href="submitting-applications.html#master-urls"> allowed master URL's</a>.
</td>
</tr>
</table>
<p>Apart from these, the following properties are also available, and may be useful in some situations:</p>
<h4 id="runtime-environment">Runtime Environment</h4>
<table class="table">
<tr><th>Property Name</th><th>Default</th><th>Meaning</th></tr>
<tr>
<td><code>spark.driver.extraClassPath</code></td>
<td>(none)</td>
<td>
Extra classpath entries to prepend to the classpath of the driver.
<br /><em>Note:</em> In client mode, this config must not be set through the <code>SparkConf</code>
directly in your application, because the driver JVM has already started at that point.
Instead, please set this through the <code>--driver-class-path</code> command line option or in
your default properties file.</td>
</tr>
<tr>
<td><code>spark.driver.extraJavaOptions</code></td>
<td>(none)</td>
<td>
A string of extra JVM options to pass to the driver. For instance, GC settings or other logging.
<br /><em>Note:</em> In client mode, this config must not be set through the <code>SparkConf</code>
directly in your application, because the driver JVM has already started at that point.
Instead, please set this through the <code>--driver-java-options</code> command line option or in
your default properties file.</td>
</tr>
<tr>
<td><code>spark.driver.extraLibraryPath</code></td>
<td>(none)</td>
<td>
Set a special library path to use when launching the driver JVM.
<br /><em>Note:</em> In client mode, this config must not be set through the <code>SparkConf</code>
directly in your application, because the driver JVM has already started at that point.
Instead, please set this through the <code>--driver-library-path</code> command line option or in
your default properties file.</td>
</tr>
<tr>
<td><code>spark.driver.userClassPathFirst</code></td>
<td>false</td>
<td>
(Experimental) Whether to give user-added jars precedence over Spark's own jars when loading
classes in the the driver. This feature can be used to mitigate conflicts between Spark's
dependencies and user dependencies. It is currently an experimental feature.
This is used in cluster mode only.
</td>
</tr>
<tr>
<td><code>spark.executor.extraClassPath</code></td>
<td>(none)</td>
<td>
Extra classpath entries to prepend to the classpath of executors. This exists primarily for
backwards-compatibility with older versions of Spark. Users typically should not need to set
this option.
</td>
</tr>
<tr>
<td><code>spark.executor.extraJavaOptions</code></td>
<td>(none)</td>
<td>
A string of extra JVM options to pass to executors. For instance, GC settings or other logging.
Note that it is illegal to set Spark properties or heap size settings with this option. Spark
properties should be set using a SparkConf object or the spark-defaults.conf file used with the
spark-submit script. Heap size settings can be set with spark.executor.memory.
</td>
</tr>
<tr>
<td><code>spark.executor.extraLibraryPath</code></td>
<td>(none)</td>
<td>
Set a special library path to use when launching executor JVM's.
</td>
</tr>
<tr>
<td><code>spark.executor.logs.rolling.maxRetainedFiles</code></td>
<td>(none)</td>
<td>
Sets the number of latest rolling log files that are going to be retained by the system.
Older log files will be deleted. Disabled by default.
</td>
</tr>
<tr>
<td><code>spark.executor.logs.rolling.maxSize</code></td>
<td>(none)</td>
<td>
Set the max size of the file by which the executor logs will be rolled over.
Rolling is disabled by default. See <code>spark.executor.logs.rolling.maxRetainedFiles</code>
for automatic cleaning of old logs.
</td>
</tr>
<tr>
<td><code>spark.executor.logs.rolling.strategy</code></td>
<td>(none)</td>
<td>
Set the strategy of rolling of executor logs. By default it is disabled. It can
be set to "time" (time-based rolling) or "size" (size-based rolling). For "time",
use <code>spark.executor.logs.rolling.time.interval</code> to set the rolling interval.
For "size", use <code>spark.executor.logs.rolling.size.maxBytes</code> to set
the maximum file size for rolling.
</td>
</tr>
<tr>
<td><code>spark.executor.logs.rolling.time.interval</code></td>
<td>daily</td>
<td>
Set the time interval by which the executor logs will be rolled over.
Rolling is disabled by default. Valid values are `daily`, `hourly`, `minutely` or
any interval in seconds. See <code>spark.executor.logs.rolling.maxRetainedFiles</code>
for automatic cleaning of old logs.
</td>
</tr>
<tr>
<td><code>spark.executor.userClassPathFirst</code></td>
<td>false</td>
<td>
(Experimental) Same functionality as <code>spark.driver.userClassPathFirst</code>, but
applied to executor instances.
</td>
</tr>
<tr>
<td><code>spark.executorEnv.[EnvironmentVariableName]</code></td>
<td>(none)</td>
<td>
Add the environment variable specified by <code>EnvironmentVariableName</code> to the Executor
process. The user can specify multiple of these to set multiple environment variables.
</td>
</tr>
<tr>
<td><code>spark.python.profile</code></td>
<td>false</td>
<td>
Enable profiling in Python worker, the profile result will show up by `sc.show_profiles()`,
or it will be displayed before the driver exiting. It also can be dumped into disk by
`sc.dump_profiles(path)`. If some of the profile results had been displayed manually,
they will not be displayed automatically before driver exiting.
By default the `pyspark.profiler.BasicProfiler` will be used, but this can be overridden by
passing a profiler class in as a parameter to the `SparkContext` constructor.
</td>
</tr>
<tr>
<td><code>spark.python.profile.dump</code></td>
<td>(none)</td>
<td>
The directory which is used to dump the profile result before driver exiting.
The results will be dumped as separated file for each RDD. They can be loaded
by ptats.Stats(). If this is specified, the profile result will not be displayed
automatically.
</td>
</tr>
<tr>
<td><code>spark.python.worker.memory</code></td>
<td>512m</td>
<td>
Amount of memory to use per python worker process during aggregation, in the same
format as JVM memory strings (e.g. <code>512m</code>, <code>2g</code>). If the memory
used during aggregation goes above this amount, it will spill the data into disks.
</td>
</tr>
<tr>
<td><code>spark.python.worker.reuse</code></td>
<td>true</td>
<td>
Reuse Python worker or not. If yes, it will use a fixed number of Python workers,
does not need to fork() a Python process for every tasks. It will be very useful
if there is large broadcast, then the broadcast will not be needed to transfered
from JVM to Python worker for every task.
</td>
</tr>
</table>
<h4 id="shuffle-behavior">Shuffle Behavior</h4>
<table class="table">
<tr><th>Property Name</th><th>Default</th><th>Meaning</th></tr>
<tr>
<td><code>spark.reducer.maxSizeInFlight</code></td>
<td>48m</td>
<td>
Maximum size of map outputs to fetch simultaneously from each reduce task. Since
each output requires us to create a buffer to receive it, this represents a fixed memory
overhead per reduce task, so keep it small unless you have a large amount of memory.
</td>
</tr>
<tr>
<td><code>spark.shuffle.blockTransferService</code></td>
<td>netty</td>
<td>
Implementation to use for transferring shuffle and cached blocks between executors. There
are two implementations available: <code>netty</code> and <code>nio</code>. Netty-based
block transfer is intended to be simpler but equally efficient and is the default option
starting in 1.2, and <code>nio</code> block transfer is deprecated in Spark 1.5.0 and will
be removed in Spark 1.6.0.
</td>
</tr>
<tr>
<td><code>spark.shuffle.compress</code></td>
<td>true</td>
<td>
Whether to compress map output files. Generally a good idea. Compression will use
<code>spark.io.compression.codec</code>.
</td>
</tr>
<tr>
<td><code>spark.shuffle.consolidateFiles</code></td>
<td>false</td>
<td>
If set to "true", consolidates intermediate files created during a shuffle. Creating fewer
files can improve filesystem performance for shuffles with large numbers of reduce tasks. It
is recommended to set this to "true" when using ext4 or xfs filesystems. On ext3, this option
might degrade performance on machines with many (>8) cores due to filesystem limitations.
</td>
</tr>
<tr>
<td><code>spark.shuffle.file.buffer</code></td>
<td>32k</td>
<td>
Size of the in-memory buffer for each shuffle file output stream. These buffers
reduce the number of disk seeks and system calls made in creating intermediate shuffle files.
</td>
</tr>
<tr>
<td><code>spark.shuffle.io.maxRetries</code></td>
<td>3</td>
<td>
(Netty only) Fetches that fail due to IO-related exceptions are automatically retried if this is
set to a non-zero value. This retry logic helps stabilize large shuffles in the face of long GC
pauses or transient network connectivity issues.
</td>
</tr>
<tr>
<td><code>spark.shuffle.io.numConnectionsPerPeer</code></td>
<td>1</td>
<td>
(Netty only) Connections between hosts are reused in order to reduce connection buildup for
large clusters. For clusters with many hard disks and few hosts, this may result in insufficient
concurrency to saturate all disks, and so users may consider increasing this value.
</td>
</tr>
<tr>
<td><code>spark.shuffle.io.preferDirectBufs</code></td>
<td>true</td>
<td>
(Netty only) Off-heap buffers are used to reduce garbage collection during shuffle and cache
block transfer. For environments where off-heap memory is tightly limited, users may wish to
turn this off to force all allocations from Netty to be on-heap.
</td>
</tr>
<tr>
<td><code>spark.shuffle.io.retryWait</code></td>
<td>5s</td>
<td>
(Netty only) How long to wait between retries of fetches. The maximum delay caused by retrying
is 15 seconds by default, calculated as <code>maxRetries * retryWait</code>.
</td>
</tr>
<tr>
<td><code>spark.shuffle.manager</code></td>
<td>sort</td>
<td>
Implementation to use for shuffling data. There are three implementations available:
<code>sort</code>, <code>hash</code> and the new (1.5+) <code>tungsten-sort</code>.
Sort-based shuffle is more memory-efficient and is the default option starting in 1.2.
Tungsten-sort is similar to the sort based shuffle, with a direct binary cache-friendly
implementation with a fall back to regular sort based shuffle if its requirements are not
met.
</td>
</tr>
<tr>
<td><code>spark.shuffle.memoryFraction</code></td>
<td>0.2</td>
<td>
Fraction of Java heap to use for aggregation and cogroups during shuffles, if
<code>spark.shuffle.spill</code> is true. At any given time, the collective size of
all in-memory maps used for shuffles is bounded by this limit, beyond which the contents will
begin to spill to disk. If spills are often, consider increasing this value at the expense of
<code>spark.storage.memoryFraction</code>.
</td>
</tr>
<tr>
<td><code>spark.shuffle.service.enabled</code></td>
<td>false</td>
<td>
Enables the external shuffle service. This service preserves the shuffle files written by
executors so the executors can be safely removed. This must be enabled if
<code>spark.dynamicAllocation.enabled</code> is "true". The external shuffle service
must be set up in order to enable it. See
<a href="job-scheduling.html#configuration-and-setup">dynamic allocation
configuration and setup documentation</a> for more information.
</td>
</tr>
<tr>
<td><code>spark.shuffle.service.port</code></td>
<td>7337</td>
<td>
Port on which the external shuffle service will run.
</td>
</tr>
<tr>
<td><code>spark.shuffle.sort.bypassMergeThreshold</code></td>
<td>200</td>
<td>
(Advanced) In the sort-based shuffle manager, avoid merge-sorting data if there is no
map-side aggregation and there are at most this many reduce partitions.
</td>
</tr>
<tr>
<td><code>spark.shuffle.spill</code></td>
<td>true</td>
<td>
If set to "true", limits the amount of memory used during reduces by spilling data out to disk.
This spilling threshold is specified by <code>spark.shuffle.memoryFraction</code>.
</td>
</tr>
<tr>
<td><code>spark.shuffle.spill.compress</code></td>
<td>true</td>
<td>
Whether to compress data spilled during shuffles. Compression will use
<code>spark.io.compression.codec</code>.
</td>
</tr>
</table>
<h4 id="spark-ui">Spark UI</h4>
<table class="table">
<tr><th>Property Name</th><th>Default</th><th>Meaning</th></tr>
<tr>
<td><code>spark.eventLog.compress</code></td>
<td>false</td>
<td>
Whether to compress logged events, if <code>spark.eventLog.enabled</code> is true.
</td>
</tr>
<tr>
<td><code>spark.eventLog.dir</code></td>
<td>file:///tmp/spark-events</td>
<td>
Base directory in which Spark events are logged, if <code>spark.eventLog.enabled</code> is true.
Within this base directory, Spark creates a sub-directory for each application, and logs the
events specific to the application in this directory. Users may want to set this to
a unified location like an HDFS directory so history files can be read by the history server.
</td>
</tr>
<tr>
<td><code>spark.eventLog.enabled</code></td>
<td>false</td>
<td>
Whether to log Spark events, useful for reconstructing the Web UI after the application has
finished.
</td>
</tr>
<tr>
<td><code>spark.ui.killEnabled</code></td>
<td>true</td>
<td>
Allows stages and corresponding jobs to be killed from the web ui.
</td>
</tr>
<tr>
<td><code>spark.ui.port</code></td>
<td>4040</td>
<td>
Port for your application's dashboard, which shows memory and workload data.
</td>
</tr>
<tr>
<td><code>spark.ui.retainedJobs</code></td>
<td>1000</td>
<td>
How many jobs the Spark UI and status APIs remember before garbage
collecting.
</td>
</tr>
<tr>
<td><code>spark.ui.retainedStages</code></td>
<td>1000</td>
<td>
How many stages the Spark UI and status APIs remember before garbage
collecting.
</td>
</tr>
<tr>
<td><code>spark.worker.ui.retainedExecutors</code></td>
<td>1000</td>
<td>
How many finished executors the Spark UI and status APIs remember before garbage collecting.
</td>
</tr>
<tr>
<td><code>spark.worker.ui.retainedDrivers</code></td>
<td>1000</td>
<td>
How many finished drivers the Spark UI and status APIs remember before garbage collecting.
</td>
</tr>
<tr>
<td><code>spark.sql.ui.retainedExecutions</code></td>
<td>1000</td>
<td>
How many finished executions the Spark UI and status APIs remember before garbage collecting.
</td>
</tr>
<tr>
<td><code>spark.streaming.ui.retainedBatches</code></td>
<td>1000</td>
<td>
How many finished batches the Spark UI and status APIs remember before garbage collecting.
</td>
</tr>
</table>
<h4 id="compression-and-serialization">Compression and Serialization</h4>
<table class="table">
<tr><th>Property Name</th><th>Default</th><th>Meaning</th></tr>
<tr>
<td><code>spark.broadcast.compress</code></td>
<td>true</td>
<td>
Whether to compress broadcast variables before sending them. Generally a good idea.
</td>
</tr>
<tr>
<td><code>spark.closure.serializer</code></td>
<td>org.apache.spark.serializer.<br />JavaSerializer</td>
<td>
Serializer class to use for closures. Currently only the Java serializer is supported.
</td>
</tr>
<tr>
<td><code>spark.io.compression.codec</code></td>
<td>snappy</td>
<td>
The codec used to compress internal data such as RDD partitions, broadcast variables and
shuffle outputs. By default, Spark provides three codecs: <code>lz4</code>, <code>lzf</code>,
and <code>snappy</code>. You can also use fully qualified class names to specify the codec,
e.g.
<code>org.apache.spark.io.LZ4CompressionCodec</code>,
<code>org.apache.spark.io.LZFCompressionCodec</code>,
and <code>org.apache.spark.io.SnappyCompressionCodec</code>.
</td>
</tr>
<tr>
<td><code>spark.io.compression.lz4.blockSize</code></td>
<td>32k</td>
<td>
Block size used in LZ4 compression, in the case when LZ4 compression codec
is used. Lowering this block size will also lower shuffle memory usage when LZ4 is used.
</td>
</tr>
<tr>
<td><code>spark.io.compression.snappy.blockSize</code></td>
<td>32k</td>
<td>
Block size used in Snappy compression, in the case when Snappy compression codec
is used. Lowering this block size will also lower shuffle memory usage when Snappy is used.
</td>
</tr>
<tr>
<td><code>spark.kryo.classesToRegister</code></td>
<td>(none)</td>
<td>
If you use Kryo serialization, give a comma-separated list of custom class names to register
with Kryo.
See the <a href="tuning.html#data-serialization">tuning guide</a> for more details.
</td>
</tr>
<tr>
<td><code>spark.kryo.referenceTracking</code></td>
<td>true (false when using Spark SQL Thrift Server)</td>
<td>
Whether to track references to the same object when serializing data with Kryo, which is
necessary if your object graphs have loops and useful for efficiency if they contain multiple
copies of the same object. Can be disabled to improve performance if you know this is not the
case.
</td>
</tr>
<tr>
<td><code>spark.kryo.registrationRequired</code></td>
<td>false</td>
<td>
Whether to require registration with Kryo. If set to 'true', Kryo will throw an exception
if an unregistered class is serialized. If set to false (the default), Kryo will write
unregistered class names along with each object. Writing class names can cause
significant performance overhead, so enabling this option can enforce strictly that a
user has not omitted classes from registration.
</td>
</tr>
<tr>
<td><code>spark.kryo.registrator</code></td>
<td>(none)</td>
<td>
If you use Kryo serialization, set this class to register your custom classes with Kryo. This
property is useful if you need to register your classes in a custom way, e.g. to specify a custom
field serializer. Otherwise <code>spark.kryo.classesToRegister</code> is simpler. It should be
set to a class that extends
<a href="api/scala/index.html#org.apache.spark.serializer.KryoRegistrator">
<code>KryoRegistrator</code></a>.
See the <a href="tuning.html#data-serialization">tuning guide</a> for more details.
</td>
</tr>
<tr>
<td><code>spark.kryoserializer.buffer.max</code></td>
<td>64m</td>
<td>
Maximum allowable size of Kryo serialization buffer. This must be larger than any
object you attempt to serialize. Increase this if you get a "buffer limit exceeded" exception
inside Kryo.
</td>
</tr>
<tr>
<td><code>spark.kryoserializer.buffer</code></td>
<td>64k</td>
<td>
Initial size of Kryo's serialization buffer. Note that there will be one buffer
<i>per core</i> on each worker. This buffer will grow up to
<code>spark.kryoserializer.buffer.max</code> if needed.
</td>
</tr>
<tr>
<td><code>spark.rdd.compress</code></td>
<td>false</td>
<td>
Whether to compress serialized RDD partitions (e.g. for
<code>StorageLevel.MEMORY_ONLY_SER</code>). Can save substantial space at the cost of some
extra CPU time.
</td>
</tr>
<tr>
<td><code>spark.serializer</code></td>
<td>
org.apache.spark.serializer.<br />JavaSerializer (org.apache.spark.serializer.<br />
KryoSerializer when using Spark SQL Thrift Server)
</td>
<td>
Class to use for serializing objects that will be sent over the network or need to be cached
in serialized form. The default of Java serialization works with any Serializable Java object
but is quite slow, so we recommend <a href="tuning.html">using
<code>org.apache.spark.serializer.KryoSerializer</code> and configuring Kryo serialization</a>
when speed is necessary. Can be any subclass of
<a href="api/scala/index.html#org.apache.spark.serializer.Serializer">
<code>org.apache.spark.Serializer</code></a>.
</td>
</tr>
<tr>
<td><code>spark.serializer.objectStreamReset</code></td>
<td>100</td>
<td>
When serializing using org.apache.spark.serializer.JavaSerializer, the serializer caches
objects to prevent writing redundant data, however that stops garbage collection of those
objects. By calling 'reset' you flush that info from the serializer, and allow old
objects to be collected. To turn off this periodic reset set it to -1.
By default it will reset the serializer every 100 objects.
</td>
</tr>
</table>
<h4 id="execution-behavior">Execution Behavior</h4>
<table class="table">
<tr><th>Property Name</th><th>Default</th><th>Meaning</th></tr>
<tr>
<td><code>spark.broadcast.blockSize</code></td>
<td>4m</td>
<td>
Size of each piece of a block for <code>TorrentBroadcastFactory</code>.
Too large a value decreases parallelism during broadcast (makes it slower); however, if it is
too small, <code>BlockManager</code> might take a performance hit.
</td>
</tr>
<tr>
<td><code>spark.broadcast.factory</code></td>
<td>org.apache.spark.broadcast.<br />TorrentBroadcastFactory</td>
<td>
Which broadcast implementation to use.
</td>
</tr>
<tr>
<td><code>spark.cleaner.ttl</code></td>
<td>(infinite)</td>
<td>
Duration (seconds) of how long Spark will remember any metadata (stages generated, tasks
generated, etc.). Periodic cleanups will ensure that metadata older than this duration will be
forgotten. This is useful for running Spark for many hours / days (for example, running 24/7 in
case of Spark Streaming applications). Note that any RDD that persists in memory for more than
this duration will be cleared as well.
</td>
</tr>
<tr>
<td><code>spark.executor.cores</code></td>
<td>1 in YARN mode, all the available cores on the worker in standalone mode.</td>
<td>
The number of cores to use on each executor. For YARN and standalone mode only.
In standalone mode, setting this parameter allows an application to run multiple executors on
the same worker, provided that there are enough cores on that worker. Otherwise, only one
executor per application will run on each worker.
</td>
</tr>
<tr>
<td><code>spark.default.parallelism</code></td>
<td>
For distributed shuffle operations like <code>reduceByKey</code> and <code>join</code>, the
largest number of partitions in a parent RDD. For operations like <code>parallelize</code>
with no parent RDDs, it depends on the cluster manager:
<ul>
<li>Local mode: number of cores on the local machine</li>
<li>Mesos fine grained mode: 8</li>
<li>Others: total number of cores on all executor nodes or 2, whichever is larger</li>
</ul>
</td>
<td>
Default number of partitions in RDDs returned by transformations like <code>join</code>,
<code>reduceByKey</code>, and <code>parallelize</code> when not set by user.
</td>
</tr>
<tr>
<td><code>spark.executor.heartbeatInterval</code></td>
<td>10s</td>
<td>Interval between each executor's heartbeats to the driver. Heartbeats let
the driver know that the executor is still alive and update it with metrics for in-progress
tasks.</td>
</tr>
<tr>
<td><code>spark.files.fetchTimeout</code></td>
<td>60s</td>
<td>
Communication timeout to use when fetching files added through SparkContext.addFile() from
the driver.
</td>
</tr>
<tr>
<td><code>spark.files.useFetchCache</code></td>
<td>true</td>
<td>
If set to true (default), file fetching will use a local cache that is shared by executors
that belong to the same application, which can improve task launching performance when
running many executors on the same host. If set to false, these caching optimizations will
be disabled and all executors will fetch their own copies of files. This optimization may be
disabled in order to use Spark local directories that reside on NFS filesystems (see
<a href="https://issues.apache.org/jira/browse/SPARK-6313">SPARK-6313</a> for more details).
</td>
</tr>
<tr>
<td><code>spark.files.overwrite</code></td>
<td>false</td>
<td>
Whether to overwrite files added through SparkContext.addFile() when the target file exists and
its contents do not match those of the source.
</td>
</tr>
<tr>
<td><code>spark.hadoop.cloneConf</code></td>
<td>false</td>
<td>If set to true, clones a new Hadoop <code>Configuration</code> object for each task. This
option should be enabled to work around <code>Configuration</code> thread-safety issues (see
<a href="https://issues.apache.org/jira/browse/SPARK-2546">SPARK-2546</a> for more details).
This is disabled by default in order to avoid unexpected performance regressions for jobs that
are not affected by these issues.</td>
</tr>
<tr>
<td><code>spark.hadoop.validateOutputSpecs</code></td>
<td>true</td>
<td>If set to true, validates the output specification (e.g. checking if the output directory already exists)
used in saveAsHadoopFile and other variants. This can be disabled to silence exceptions due to pre-existing
output directories. We recommend that users do not disable this except if trying to achieve compatibility with
previous versions of Spark. Simply use Hadoop's FileSystem API to delete output directories by hand.
This setting is ignored for jobs generated through Spark Streaming's StreamingContext, since
data may need to be rewritten to pre-existing output directories during checkpoint recovery.</td>
</tr>
<tr>
<td><code>spark.storage.memoryFraction</code></td>
<td>0.6</td>
<td>
Fraction of Java heap to use for Spark's memory cache. This should not be larger than the "old"
generation of objects in the JVM, which by default is given 0.6 of the heap, but you can
increase it if you configure your own old generation size.
</td>
</tr>
<tr>
<td><code>spark.storage.memoryMapThreshold</code></td>
<td>2m</td>
<td>
Size of a block above which Spark memory maps when reading a block from disk.
This prevents Spark from memory mapping very small blocks. In general, memory
mapping has high overhead for blocks close to or below the page size of the operating system.
</td>
</tr>
<tr>
<td><code>spark.storage.unrollFraction</code></td>
<td>0.2</td>
<td>
Fraction of <code>spark.storage.memoryFraction</code> to use for unrolling blocks in memory.
This is dynamically allocated by dropping existing blocks when there is not enough free
storage space to unroll the new block in its entirety.
</td>
</tr>
<tr>
<td><code>spark.externalBlockStore.blockManager</code></td>
<td>org.apache.spark.storage.TachyonBlockManager</td>
<td>
Implementation of external block manager (file system) that store RDDs. The file system's URL is set by
<code>spark.externalBlockStore.url</code>.
</td>
</tr>
<tr>
<td><code>spark.externalBlockStore.baseDir</code></td>
<td>System.getProperty("java.io.tmpdir")</td>
<td>
Directories of the external block store that store RDDs. The file system's URL is set by
<code>spark.externalBlockStore.url</code> It can also be a comma-separated list of multiple
directories on Tachyon file system.
</td>
</tr>
<tr>
<td><code>spark.externalBlockStore.url</code></td>
<td>tachyon://localhost:19998 for Tachyon</td>
<td>
The URL of the underlying external blocker file system in the external block store.
</td>
</tr>
</table>
<h4 id="networking">Networking</h4>
<table class="table">
<tr><th>Property Name</th><th>Default</th><th>Meaning</th></tr>
<tr>
<td><code>spark.akka.frameSize</code></td>
<td>128</td>
<td>
Maximum message size to allow in "control plane" communication; generally only applies to map
output size information sent between executors and the driver. Increase this if you are running
jobs with many thousands of map and reduce tasks and see messages about the frame size.
</td>
</tr>
<tr>
<td><code>spark.akka.heartbeat.interval</code></td>
<td>1000s</td>
<td>
This is set to a larger value to disable the transport failure detector that comes built in to
Akka. It can be enabled again, if you plan to use this feature (Not recommended). A larger
interval value reduces network overhead and a smaller value ( ~ 1 s) might be more
informative for Akka's failure detector. Tune this in combination of `spark.akka.heartbeat.pauses`
if you need to. A likely positive use case for using failure detector would be: a sensistive
failure detector can help evict rogue executors quickly. However this is usually not the case
as GC pauses and network lags are expected in a real Spark cluster. Apart from that enabling
this leads to a lot of exchanges of heart beats between nodes leading to flooding the network
with those.
</td>
</tr>
<tr>
<td><code>spark.akka.heartbeat.pauses</code></td>
<td>6000s</td>
<td>
This is set to a larger value to disable the transport failure detector that comes built in to Akka.
It can be enabled again, if you plan to use this feature (Not recommended). Acceptable heart
beat pause for Akka. This can be used to control sensitivity to GC pauses. Tune
this along with `spark.akka.heartbeat.interval` if you need to.
</td>
</tr>
<tr>
<td><code>spark.akka.threads</code></td>
<td>4</td>
<td>
Number of actor threads to use for communication. Can be useful to increase on large clusters
when the driver has a lot of CPU cores.
</td>
</tr>
<tr>
<td><code>spark.akka.timeout</code></td>
<td>100s</td>
<td>
Communication timeout between Spark nodes.
</td>
</tr>
<tr>
<td><code>spark.blockManager.port</code></td>
<td>(random)</td>
<td>
Port for all block managers to listen on. These exist on both the driver and the executors.
</td>
</tr>
<tr>
<td><code>spark.broadcast.port</code></td>
<td>(random)</td>
<td>
Port for the driver's HTTP broadcast server to listen on.
This is not relevant for torrent broadcast.
</td>
</tr>
<tr>
<td><code>spark.driver.host</code></td>
<td>(local hostname)</td>
<td>
Hostname or IP address for the driver to listen on.
This is used for communicating with the executors and the standalone Master.
</td>
</tr>
<tr>
<td><code>spark.driver.port</code></td>
<td>(random)</td>
<td>
Port for the driver to listen on.
This is used for communicating with the executors and the standalone Master.
</td>
</tr>
<tr>
<td><code>spark.executor.port</code></td>
<td>(random)</td>
<td>
Port for the executor to listen on. This is used for communicating with the driver.
</td>
</tr>
<tr>
<td><code>spark.fileserver.port</code></td>
<td>(random)</td>
<td>
Port for the driver's HTTP file server to listen on.
</td>
</tr>
<tr>
<td><code>spark.network.timeout</code></td>
<td>120s</td>
<td>
Default timeout for all network interactions. This config will be used in place of
<code>spark.core.connection.ack.wait.timeout</code>, <code>spark.akka.timeout</code>,
<code>spark.storage.blockManagerSlaveTimeoutMs</code>,
<code>spark.shuffle.io.connectionTimeout</code>, <code>spark.rpc.askTimeout</code> or
<code>spark.rpc.lookupTimeout</code> if they are not configured.
</td>
</tr>
<tr>
<td><code>spark.port.maxRetries</code></td>
<td>16</td>
<td>
Default maximum number of retries when binding to a port before giving up.
</td>
</tr>
<tr>
<td><code>spark.replClassServer.port</code></td>
<td>(random)</td>
<td>
Port for the driver's HTTP class server to listen on.
This is only relevant for the Spark shell.
</td>
</tr>
<tr>
<td><code>spark.rpc.numRetries</code></td>
<td>3</td>
<td>
Number of times to retry before an RPC task gives up.
An RPC task will run at most times of this number.
</td>
</tr>
<tr>
<td><code>spark.rpc.retry.wait</code></td>
<td>3s</td>
<td>
Duration for an RPC ask operation to wait before retrying.
</td>
</tr>
<tr>
<td><code>spark.rpc.askTimeout</code></td>
<td>120s</td>
<td>
Duration for an RPC ask operation to wait before timing out.
</td>
</tr>
<tr>
<td><code>spark.rpc.lookupTimeout</code></td>
<td>120s</td>
<td>
Duration for an RPC remote endpoint lookup operation to wait before timing out.
</td>
</tr>
</table>
<h4 id="scheduling">Scheduling</h4>
<table class="table">
<tr><th>Property Name</th><th>Default</th><th>Meaning</th></tr>
<tr>
<td><code>spark.cores.max</code></td>
<td>(not set)</td>
<td>
When running on a <a href="spark-standalone.html">standalone deploy cluster</a> or a
<a href="running-on-mesos.html#mesos-run-modes">Mesos cluster in "coarse-grained"
sharing mode</a>, the maximum amount of CPU cores to request for the application from
across the cluster (not from each machine). If not set, the default will be
<code>spark.deploy.defaultCores</code> on Spark's standalone cluster manager, or
infinite (all available cores) on Mesos.
</td>
</tr>
<tr>
<td><code>spark.locality.wait</code></td>
<td>3s</td>
<td>
How long to wait to launch a data-local task before giving up and launching it
on a less-local node. The same wait will be used to step through multiple locality levels
(process-local, node-local, rack-local and then any). It is also possible to customize the
waiting time for each level by setting <code>spark.locality.wait.node</code>, etc.
You should increase this setting if your tasks are long and see poor locality, but the
default usually works well.
</td>
</tr>
<tr>
<td><code>spark.locality.wait.node</code></td>
<td>spark.locality.wait</td>
<td>
Customize the locality wait for node locality. For example, you can set this to 0 to skip
node locality and search immediately for rack locality (if your cluster has rack information).
</td>
</tr>
<tr>
<td><code>spark.locality.wait.process</code></td>
<td>spark.locality.wait</td>
<td>
Customize the locality wait for process locality. This affects tasks that attempt to access
cached data in a particular executor process.
</td>
</tr>
<tr>
<td><code>spark.locality.wait.rack</code></td>
<td>spark.locality.wait</td>
<td>
Customize the locality wait for rack locality.
</td>
</tr>
<tr>
<td><code>spark.scheduler.maxRegisteredResourcesWaitingTime</code></td>
<td>30s</td>
<td>
Maximum amount of time to wait for resources to register before scheduling begins.
</td>
</tr>
<tr>
<td><code>spark.scheduler.minRegisteredResourcesRatio</code></td>
<td>0.8 for YARN mode; 0.0 otherwise</td>
<td>
The minimum ratio of registered resources (registered resources / total expected resources)
(resources are executors in yarn mode, CPU cores in standalone mode)
to wait for before scheduling begins. Specified as a double between 0.0 and 1.0.
Regardless of whether the minimum ratio of resources has been reached,
the maximum amount of time it will wait before scheduling begins is controlled by config
<code>spark.scheduler.maxRegisteredResourcesWaitingTime</code>.
</td>
</tr>
<tr>
<td><code>spark.scheduler.mode</code></td>
<td>FIFO</td>
<td>
The <a href="job-scheduling.html#scheduling-within-an-application">scheduling mode</a> between
jobs submitted to the same SparkContext. Can be set to <code>FAIR</code>
to use fair sharing instead of queueing jobs one after another. Useful for
multi-user services.
</td>
</tr>
<tr>
<td><code>spark.scheduler.revive.interval</code></td>
<td>1s</td>
<td>
The interval length for the scheduler to revive the worker resource offers to run tasks.
</td>
</tr>
<tr>
<td><code>spark.speculation</code></td>
<td>false</td>
<td>
If set to "true", performs speculative execution of tasks. This means if one or more tasks are
running slowly in a stage, they will be re-launched.
</td>
</tr>
<tr>
<td><code>spark.speculation.interval</code></td>
<td>100ms</td>
<td>
How often Spark will check for tasks to speculate.
</td>
</tr>
<tr>
<td><code>spark.speculation.multiplier</code></td>
<td>1.5</td>
<td>
How many times slower a task is than the median to be considered for speculation.
</td>
</tr>
<tr>
<td><code>spark.speculation.quantile</code></td>
<td>0.75</td>
<td>
Percentage of tasks which must be complete before speculation is enabled for a particular stage.
</td>
</tr>
<tr>
<td><code>spark.task.cpus</code></td>
<td>1</td>
<td>
Number of cores to allocate for each task.
</td>
</tr>
<tr>
<td><code>spark.task.maxFailures</code></td>
<td>4</td>
<td>
Number of individual task failures before giving up on the job.
Should be greater than or equal to 1. Number of allowed retries = this value - 1.
</td>
</tr>
</table>
<h4 id="dynamic-allocation">Dynamic Allocation</h4>
<table class="table">
<tr><th>Property Name</th><th>Default</th><th>Meaning</th></tr>
<tr>
<td><code>spark.dynamicAllocation.enabled</code></td>
<td>false</td>
<td>
Whether to use dynamic resource allocation, which scales the number of executors registered
with this application up and down based on the workload. Note that this is currently only
available on YARN mode. For more detail, see the description
<a href="job-scheduling.html#dynamic-resource-allocation">here</a>.
<br /><br />
This requires <code>spark.shuffle.service.enabled</code> to be set.
The following configurations are also relevant:
<code>spark.dynamicAllocation.minExecutors</code>,
<code>spark.dynamicAllocation.maxExecutors</code>, and
<code>spark.dynamicAllocation.initialExecutors</code>
</td>
</tr>
<tr>
<td><code>spark.dynamicAllocation.executorIdleTimeout</code></td>
<td>60s</td>
<td>
If dynamic allocation is enabled and an executor has been idle for more than this duration,
the executor will be removed. For more detail, see this
<a href="job-scheduling.html#resource-allocation-policy">description</a>.
</td>
</tr>
<tr>
<td><code>spark.dynamicAllocation.cachedExecutorIdleTimeout</code></td>
<td>infinity</td>
<td>
If dynamic allocation is enabled and an executor which has cached data blocks has been idle for more than this duration,
the executor will be removed. For more details, see this
<a href="job-scheduling.html#resource-allocation-policy">description</a>.
</td>
</tr>
<tr>
<td><code>spark.dynamicAllocation.initialExecutors</code></td>
<td><code>spark.dynamicAllocation.minExecutors</code></td>
<td>
Initial number of executors to run if dynamic allocation is enabled.
</td>
</tr>
<tr>
<td><code>spark.dynamicAllocation.maxExecutors</code></td>
<td>infinity</td>
<td>
Upper bound for the number of executors if dynamic allocation is enabled.
</td>
</tr>
<tr>
<td><code>spark.dynamicAllocation.minExecutors</code></td>
<td>0</td>
<td>
Lower bound for the number of executors if dynamic allocation is enabled.
</td>
</tr>
<tr>
<td><code>spark.dynamicAllocation.schedulerBacklogTimeout</code></td>
<td>1s</td>
<td>
If dynamic allocation is enabled and there have been pending tasks backlogged for more than
this duration, new executors will be requested. For more detail, see this
<a href="job-scheduling.html#resource-allocation-policy">description</a>.
</td>
</tr>
<tr>
<td><code>spark.dynamicAllocation.sustainedSchedulerBacklogTimeout</code></td>
<td><code>schedulerBacklogTimeout</code></td>
<td>
Same as <code>spark.dynamicAllocation.schedulerBacklogTimeout</code>, but used only for
subsequent executor requests. For more detail, see this
<a href="job-scheduling.html#resource-allocation-policy">description</a>.
</td>
</tr>
</table>
<h4 id="security">Security</h4>
<table class="table">
<tr><th>Property Name</th><th>Default</th><th>Meaning</th></tr>
<tr>
<td><code>spark.acls.enable</code></td>
<td>false</td>
<td>
Whether Spark acls should are enabled. If enabled, this checks to see if the user has
access permissions to view or modify the job. Note this requires the user to be known,
so if the user comes across as null no checks are done. Filters can be used with the UI
to authenticate and set the user.
</td>
</tr>
<tr>
<td><code>spark.admin.acls</code></td>
<td>Empty</td>
<td>
Comma separated list of users/administrators that have view and modify access to all Spark jobs.
This can be used if you run on a shared cluster and have a set of administrators or devs who
help debug when things work.
</td>
</tr>
<tr>
<td><code>spark.authenticate</code></td>
<td>false</td>
<td>
Whether Spark authenticates its internal connections. See
<code>spark.authenticate.secret</code> if not running on YARN.
</td>
</tr>
<tr>
<td><code>spark.authenticate.secret</code></td>
<td>None</td>
<td>
Set the secret key used for Spark to authenticate between components. This needs to be set if
not running on YARN and authentication is enabled.
</td>
</tr>
<tr>
<td><code>spark.authenticate.enableSaslEncryption</code></td>
<td>false</td>
<td>
Enable encrypted communication when authentication is enabled. This option is currently
only supported by the block transfer service.
</td>
</tr>
<tr>
<td><code>spark.network.sasl.serverAlwaysEncrypt</code></td>
<td>false</td>
<td>
Disable unencrypted connections for services that support SASL authentication. This is
currently supported by the external shuffle service.
</td>
</tr>
<tr>
<td><code>spark.core.connection.ack.wait.timeout</code></td>
<td>60s</td>
<td>
How long for the connection to wait for ack to occur before timing
out and giving up. To avoid unwilling timeout caused by long pause like GC,
you can set larger value.
</td>
</tr>
<tr>
<td><code>spark.core.connection.auth.wait.timeout</code></td>
<td>30s</td>
<td>
How long for the connection to wait for authentication to occur before timing
out and giving up.
</td>
</tr>
<tr>
<td><code>spark.modify.acls</code></td>
<td>Empty</td>
<td>
Comma separated list of users that have modify access to the Spark job. By default only the
user that started the Spark job has access to modify it (kill it for example).
</td>
</tr>
<tr>
<td><code>spark.ui.filters</code></td>
<td>None</td>
<td>
Comma separated list of filter class names to apply to the Spark web UI. The filter should be a
standard <a href="http://docs.oracle.com/javaee/6/api/javax/servlet/Filter.html">
javax servlet Filter</a>. Parameters to each filter can also be specified by setting a
java system property of: <br />
<code>spark.<class name of filter>.params='param1=value1,param2=value2'</code><br />
For example: <br />
<code>-Dspark.ui.filters=com.test.filter1</code> <br />
<code>-Dspark.com.test.filter1.params='param1=foo,param2=testing'</code>
</td>
</tr>
<tr>
<td><code>spark.ui.view.acls</code></td>
<td>Empty</td>
<td>
Comma separated list of users that have view access to the Spark web ui. By default only the
user that started the Spark job has view access.
</td>
</tr>
</table>
<h4 id="encryption">Encryption</h4>
<table class="table">
<tr><th>Property Name</th><th>Default</th><th>Meaning</th></tr>
<tr>
<td><code>spark.ssl.enabled</code></td>
<td>false</td>
<td>
<p>Whether to enable SSL connections on all supported protocols.</p>
<p>All the SSL settings like <code>spark.ssl.xxx</code> where <code>xxx</code> is a
particular configuration property, denote the global configuration for all the supported
protocols. In order to override the global configuration for the particular protocol,
the properties must be overwritten in the protocol-specific namespace.</p>
<p>Use <code>spark.ssl.YYY.XXX</code> settings to overwrite the global configuration for
particular protocol denoted by <code>YYY</code>. Currently <code>YYY</code> can be
either <code>akka</code> for Akka based connections or <code>fs</code> for broadcast and
file server.</p>
</td>
</tr>
<tr>
<td><code>spark.ssl.enabledAlgorithms</code></td>
<td>Empty</td>
<td>
A comma separated list of ciphers. The specified ciphers must be supported by JVM.
The reference list of protocols one can find on
<a href="https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https">this</a>
page.
</td>
</tr>
<tr>
<td><code>spark.ssl.keyPassword</code></td>
<td>None</td>
<td>
A password to the private key in key-store.
</td>
</tr>
<tr>
<td><code>spark.ssl.keyStore</code></td>
<td>None</td>
<td>
A path to a key-store file. The path can be absolute or relative to the directory where
the component is started in.
</td>
</tr>
<tr>
<td><code>spark.ssl.keyStorePassword</code></td>
<td>None</td>
<td>
A password to the key-store.
</td>
</tr>
<tr>
<td><code>spark.ssl.protocol</code></td>
<td>None</td>
<td>
A protocol name. The protocol must be supported by JVM. The reference list of protocols
one can find on <a href="https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https">this</a>
page.
</td>
</tr>
<tr>
<td><code>spark.ssl.trustStore</code></td>
<td>None</td>
<td>
A path to a trust-store file. The path can be absolute or relative to the directory
where the component is started in.
</td>
</tr>
<tr>
<td><code>spark.ssl.trustStorePassword</code></td>
<td>None</td>
<td>
A password to the trust-store.
</td>
</tr>
</table>
<h4 id="spark-streaming">Spark Streaming</h4>
<table class="table">
<tr><th>Property Name</th><th>Default</th><th>Meaning</th></tr>
<tr>
<td><code>spark.streaming.backpressure.enabled</code></td>
<td>false</td>
<td>
Enables or disables Spark Streaming's internal backpressure mechanism (since 1.5).
This enables the Spark Streaming to control the receiving rate based on the
current batch scheduling delays and processing times so that the system receives
only as fast as the system can process. Internally, this dynamically sets the
maximum receiving rate of receivers. This rate is upper bounded by the values
`spark.streaming.receiver.maxRate` and `spark.streaming.kafka.maxRatePerPartition`
if they are set (see below).
</td>
</tr>
<tr>
<td><code>spark.streaming.blockInterval</code></td>
<td>200ms</td>
<td>
Interval at which data received by Spark Streaming receivers is chunked
into blocks of data before storing them in Spark. Minimum recommended - 50 ms. See the
<a href="streaming-programming-guide.html#level-of-parallelism-in-data-receiving">performance
tuning</a> section in the Spark Streaming programing guide for more details.
</td>
</tr>
<tr>
<td><code>spark.streaming.receiver.maxRate</code></td>
<td>not set</td>
<td>
Maximum rate (number of records per second) at which each receiver will receive data.
Effectively, each stream will consume at most this number of records per second.
Setting this configuration to 0 or a negative number will put no limit on the rate.
See the <a href="streaming-programming-guide.html#deploying-applications">deployment guide</a>
in the Spark Streaming programing guide for mode details.
</td>
</tr>
<tr>
<td><code>spark.streaming.receiver.writeAheadLog.enable</code></td>
<td>false</td>
<td>
Enable write ahead logs for receivers. All the input data received through receivers
will be saved to write ahead logs that will allow it to be recovered after driver failures.
See the <a href="streaming-programming-guide.html#deploying-applications">deployment guide</a>
in the Spark Streaming programing guide for more details.
</td>
</tr>
<tr>
<td><code>spark.streaming.unpersist</code></td>
<td>true</td>
<td>
Force RDDs generated and persisted by Spark Streaming to be automatically unpersisted from
Spark's memory. The raw input data received by Spark Streaming is also automatically cleared.
Setting this to false will allow the raw data and persisted RDDs to be accessible outside the
streaming application as they will not be cleared automatically. But it comes at the cost of
higher memory usage in Spark.
</td>
</tr>
<tr>
<td><code>spark.streaming.kafka.maxRatePerPartition</code></td>
<td>not set</td>
<td>
Maximum rate (number of records per second) at which data will be read from each Kafka
partition when using the new Kafka direct stream API. See the
<a href="streaming-kafka-integration.html">Kafka Integration guide</a>
for more details.
</td>
</tr>
<tr>
<td><code>spark.streaming.kafka.maxRetries</code></td>
<td>1</td>
<td>
Maximum number of consecutive retries the driver will make in order to find
the latest offsets on the leader of each partition (a default value of 1
means that the driver will make a maximum of 2 attempts). Only applies to
the new Kafka direct stream API.
</td>
</tr>
<tr>
<td><code>spark.streaming.ui.retainedBatches</code></td>
<td>1000</td>
<td>
How many batches the Spark Streaming UI and status APIs remember before garbage collecting.
</td>
</tr>
</table>
<h4 id="sparkr">SparkR</h4>
<table class="table">
<tr><th>Property Name</th><th>Default</th><th>Meaning</th></tr>
<tr>
<td><code>spark.r.numRBackendThreads</code></td>
<td>2</td>
<td>
Number of threads used by RBackend to handle RPC calls from SparkR package.
</td>
</tr>
<tr>
<td><code>spark.r.command</code></td>
<td>Rscript</td>
<td>
Executable for executing R scripts in cluster modes for both driver and workers.
</td>
</tr>
<tr>
<td><code>spark.r.driver.command</code></td>
<td>spark.r.command</td>
<td>
Executable for executing R scripts in client modes for driver. Ignored in cluster modes.
</td>
</tr>
</table>
<h4 id="cluster-managers">Cluster Managers</h4>
<p>Each cluster manager in Spark has additional configuration options. Configurations
can be found on the pages for each mode:</p>
<h5 id="yarnrunning-on-yarnhtmlconfiguration"><a href="running-on-yarn.html#configuration">YARN</a></h5>
<h5 id="mesosrunning-on-mesoshtmlconfiguration"><a href="running-on-mesos.html#configuration">Mesos</a></h5>
<h5 id="standalone-modespark-standalonehtmlcluster-launch-scripts"><a href="spark-standalone.html#cluster-launch-scripts">Standalone Mode</a></h5>
<h1 id="environment-variables">Environment Variables</h1>
<p>Certain Spark settings can be configured through environment variables, which are read from the
<code>conf/spark-env.sh</code> script in the directory where Spark is installed (or <code>conf/spark-env.cmd</code> on
Windows). In Standalone and Mesos modes, this file can give machine specific information such as
hostnames. It is also sourced when running local Spark applications or submission scripts.</p>
<p>Note that <code>conf/spark-env.sh</code> does not exist by default when Spark is installed. However, you can
copy <code>conf/spark-env.sh.template</code> to create it. Make sure you make the copy executable.</p>
<p>The following variables can be set in <code>spark-env.sh</code>:</p>
<table class="table">
<tr><th style="width:21%">Environment Variable</th><th>Meaning</th></tr>
<tr>
<td><code>JAVA_HOME</code></td>
<td>Location where Java is installed (if it's not on your default `PATH`).</td>
</tr>
<tr>
<td><code>PYSPARK_PYTHON</code></td>
<td>Python binary executable to use for PySpark in both driver and workers (default is `python`).</td>
</tr>
<tr>
<td><code>PYSPARK_DRIVER_PYTHON</code></td>
<td>Python binary executable to use for PySpark in driver only (default is PYSPARK_PYTHON).</td>
</tr>
<tr>
<td><code>SPARKR_DRIVER_R</code></td>
<td>R binary executable to use for SparkR shell (default is <code>R</code>).</td>
</tr>
<tr>
<td><code>SPARK_LOCAL_IP</code></td>
<td>IP address of the machine to bind to.</td>
</tr>
<tr>
<td><code>SPARK_PUBLIC_DNS</code></td>
<td>Hostname your Spark program will advertise to other machines.</td>
</tr>
</table>
<p>In addition to the above, there are also options for setting up the Spark
<a href="spark-standalone.html#cluster-launch-scripts">standalone cluster scripts</a>, such as number of cores
to use on each machine and maximum memory.</p>
<p>Since <code>spark-env.sh</code> is a shell script, some of these can be set programmatically – for example, you might
compute <code>SPARK_LOCAL_IP</code> by looking up the IP of a specific network interface.</p>
<h1 id="configuring-logging">Configuring Logging</h1>
<p>Spark uses <a href="http://logging.apache.org/log4j/">log4j</a> for logging. You can configure it by adding a
<code>log4j.properties</code> file in the <code>conf</code> directory. One way to start is to copy the existing
<code>log4j.properties.template</code> located there.</p>
<h1 id="overriding-configuration-directory">Overriding configuration directory</h1>
<p>To specify a different configuration directory other than the default “SPARK_HOME/conf”,
you can set SPARK_CONF_DIR. Spark will use the the configuration files (spark-defaults.conf, spark-env.sh, log4j.properties, etc)
from this directory.</p>
</div> <!-- /container -->
<script src="js/vendor/jquery-1.8.0.min.js"></script>
<script src="js/vendor/bootstrap.min.js"></script>
<script src="js/vendor/anchor.min.js"></script>
<script src="js/main.js"></script>
<!-- MathJax Section -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: { equationNumbers: { autoNumber: "AMS" } }
});
</script>
<script>
// Note that we load MathJax this way to work with local file (file://), HTTP and HTTPS.
// We could use "//cdn.mathjax...", but that won't support "file://".
(function(d, script) {
script = d.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.onload = function(){
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ["$", "$"], ["\\\\(","\\\\)"] ],
displayMath: [ ["$$","$$"], ["\\[", "\\]"] ],
processEscapes: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre']
}
});
};
script.src = ('https:' == document.location.protocol ? 'https://' : 'http://') +
'cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML';
d.getElementsByTagName('head')[0].appendChild(script);
}(document));
</script>
</body>
</html>
|