Win10安装Spark

2019/05/19

Categories: spark Tags: spark hadoop

Spark is written in Scala with programming interfaces in Python (PySpark) and Scala

cf:

安装JDK

setx /M JAVA_HOME C:\java\jdk1.8.0_211
echo %JAVA_HOME%
setx /M path "%path%;%JAVA_HOME%\bin;C:\java\jre1.8.0_211\bin"
javac -version
setx /M _JAVA_OPTIONS "-Djava.net.preferIPv4Stack=true"

cf: How to set JAVA_HOME in Windows 10

安装Scala, SBT和IntelliJ

scala
sbt

idea

cf: idea 无法创建Scala class 选项解决办法汇总

安装Hadoop

setx /M HADOOP_HOME C:\hadoop-3.1.2
setx /M path "%path%;%HADOOP_HOME%\bin"
hadoop version

安装Spark

setx /M SPARK_HOME C:\spark
setx /M path "%path%;%SPARK_HOME%\bin"
pyspark
spark-shell
spark-submit --class org.apache.spark.examples.SparkPi --master local %SPARK_HOME%\examples\jars\spark-examples*.jar 10

pi estimator

mkdir C:\tmp\hive
%HADOOP_HOME%\bin\winutils.exe chmod 777 /tmp/hive