准备工具:jdk1.8 Intellij IDEA scala2.10.5 hadoop2.6.5 spark1.6.2
IDEA配置步骤:
1.添加JDK1.8
2.安装scala插件
3.重启IDEA
4.新建scala项目,选择SBT,JDK选择1.8,scala version选择2.10.5
5.添加build.sbt:
libraryDependencies ++= Seq( "org.apache.spark" %% "spark-core" % "1.6.2" ) 点击refresh project,等待加载完成(建议开启VPN) 6:编写入口类 7.添加Artifact File->Project Structure->Artifact 8:构建编译jar包 Build->Build Artifacts 9:在服务器上用spark-submit命令提交运行jar包: spark-submit --master spark://master:7077 --class WordCount --executor-memory 512m ~/jar/my_spark.jar
发表评论
抢沙发~