先安装scala
下载scala-2.11.12.tgz
解压
tar -zxf scala-2.11.12.tgz
移动至想要的目录
mv scala-2.11.12 /usr/scala/
设置环境变量
gedit /etc/profile
export SCALA_HOME=/usr/scala/scala-2.11.12
export PATH=$PATH:$SCALA_HOME/bin
scala -version验证是否成功
安装spark
下载spark-2.4.0-bin-hadoop2.7.tgz
解压
tar -zxvf spark-2.4.0-bin-hadoop2.7.tgz
移动至想要的目录
mv spark-2.4.0-bin-hadoop2.7 /usr/spark/spark-2.4.0/
设置环境变量
gedit /etc/profile
export SPARK_HOME=/usr/spark/spark-2.4.0
export PATH=$PATH:$SPARK_HOME/bin
设置spark
1.gedit /usr/spark/spark-2.4.0/conf/spark-env.sh
export JAVA_HOME=/usr/java/jdk1.8.0_191
export HADOOP_HOME=/usr/hadoop/hadoop-2.9.2
export SCALA_HOME=/usr/scala/scala-2.11.12
export SPARK_HOME=/usr/spark/spark-2.4.0
export HADOOP_CONF_DIR=/usr/hadoop/hadoop-2.9.2/etc/hadoop
export SPARK_MASTER_IP=master
export SPARK_WORKER_MEMORY=4g
export SPARK_WORKER_CORES=2
export SPARK_WORKER_INSTANCES=1
2.gedit slaves
master
slave01
slave02
分发spark
rsync -avz --delete /usr/spark/ worker01:/usr/spark/
rsync -avz --delete /usr/spark/ worker02:/usr/spark/
rsync -avz --delete /usr/spark/ worker03:/usr/spark/
rsync -avz --delete /usr/spark/ servant01:/usr/spark/
rsync -avz --delete /usr/spark/ servant02:/usr/spark/
rsync -avz --delete /usr/spark/ servant03:/usr/spark/