@@ -18,9 +18,13 @@ docker build --rm -t sequenceiq/spark:1.4.0 .
18
18
19
19
* if using boot2docker make sure your VM has more than 2GB memory
20
20
* in your /etc/hosts file add $(boot2docker ip) as host 'sandbox' to make it easier to access your sandbox UI
21
- * open UI ports when starting image
21
+ * open yarn UI ports when running container
22
22
```
23
- docker run -it -p 8088:8088 -p 8042:8042 -p 8080:8080 -p 7077:7077 -p 6066:6066 -h sandbox sequenceiq/spark:1.4.0 bash
23
+ docker run -it -p 8088:8088 -p 8042:8042 -h sandbox sequenceiq/spark:1.4.0 bash
24
+ ```
25
+ or
26
+ ```
27
+ docker run -d -h sandbox sequenceiq/spark:1.3.1 -d
24
28
```
25
29
26
30
## Versions
@@ -38,8 +42,11 @@ In yarn-client mode, the driver runs in the client process, and the application
38
42
39
43
```
40
44
# run the spark shell
41
- # set memory limits appropriately or spark context will not be able to start
42
- spark-shell --master yarn-client --driver-memory 1g --executor-memory 1g --executor-cores 1
45
+ spark-shell \
46
+ --master yarn-client \
47
+ --driver-memory 1g \
48
+ --executor-memory 1g \
49
+ --executor-cores 1
43
50
44
51
# execute the the following command which should return 1000
45
52
scala> sc.parallelize(1 to 1000).count()
@@ -52,12 +59,26 @@ Estimating Pi (yarn-cluster mode):
52
59
53
60
```
54
61
# execute the the following command which should write the "Pi is roughly 3.1418" into the logs
55
- spark-submit --class org.apache.spark.examples.SparkPi --master yarn-cluster --driver-memory 1g --executor-memory 1g --executor-cores 1 $SPARK_HOME/lib/spark-examples-1.4.0-hadoop2.6.0.jar
62
+ # note you must specify --files argument in cluster mode to enable metrics
63
+ spark-submit \
64
+ --class org.apache.spark.examples.SparkPi \
65
+ --files $SPARK_HOME/conf/metrics.properties \
66
+ --master yarn-cluster \
67
+ --driver-memory 1g \
68
+ --executor-memory 1g \
69
+ --executor-cores 1 \
70
+ $SPARK_HOME/lib/spark-examples-1.4.0-hadoop2.6.0.jar
56
71
```
57
72
58
73
Estimating Pi (yarn-client mode):
59
74
60
75
```
61
76
# execute the the following command which should print the "Pi is roughly 3.1418" to the screen
62
- spark-submit --class org.apache.spark.examples.SparkPi --master yarn-client --driver-memory 1g --executor-memory 1g --executor-cores 1 $SPARK_HOME/lib/spark-examples-1.4.0-hadoop2.6.0.jar
77
+ spark-submit \
78
+ --class org.apache.spark.examples.SparkPi \
79
+ --master yarn-client \
80
+ --driver-memory 1g \
81
+ --executor-memory 1g \
82
+ --executor-cores 1 \
83
+ $SPARK_HOME/lib/spark-examples-1.4.0-hadoop2.6.0.jar
63
84
```
0 commit comments