1. Spark是Scala写的,在jvm上运行,运行环境java7+
spark 1.6.2 对应 scala 2.10 对应 sbt(打包工具) 0.13. 8 spark 2.0 对应 scala 2.11
2. 下载地址
spark http://spark.apache.org/downloads.html (下载时会自动匹配hadoop版本)
scala http://www.scala-lang.org/download/2.10.5.html
3.解压spark ,双击安装 scala
4.spark使用
在bin下有两种shell运行方式:
1. pyspark
2. spark-shell
spark shell 实例
val lines(变量)=sc.textFile("../../hellospark")
lines.count()
lines.first()
5.编辑工具使用 idea
安装 scala与sbt插件
注: idea中jar下载失败
修改或创建: c://user/home/.sbt/repositories 文件,添加以下内容:
[repositories]
local
oschina: http://maven.oschina.net/content/groups/public/
jcenter: http://jcenter.bintray.com/
typesafe-ivy-releases: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
maven-central: http://repo1.maven.org/maven2/