Update Spark单机版本环境搭建.md
This commit is contained in:
parent
2253985fee
commit
fe561d883c
@ -107,7 +107,7 @@ hadoop,hadoop
|
||||
#### 3. 在scala交互式命令行中执行如下命名
|
||||
|
||||
```scala
|
||||
val file = spark.sparkContext.textFile("file:///usr/app//wc.txt")
|
||||
val file = spark.sparkContext.textFile("file:///usr/app/wc.txt")
|
||||
val wordCounts = file.flatMap(line => line.split(",")).map((word => (word, 1))).reduceByKey(_ + _)
|
||||
wordCounts.collect
|
||||
```
|
||||
@ -118,4 +118,4 @@ wordCounts.collect
|
||||
|
||||
通过spark shell web-ui可以查看作业的执行情况,访问端口为4040
|
||||
|
||||
<div align="center"> <img src="https://github.com/heibaiying/BigData-Notes/blob/master/pictures/spark-shell-web-ui.png"/> </div>
|
||||
<div align="center"> <img src="https://github.com/heibaiying/BigData-Notes/blob/master/pictures/spark-shell-web-ui.png"/> </div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user