一.安装JDK(略)
二.安装Scala(l略)
三.安装Spark
1.上传安装包到集群节点
2.解压安装包
3.修改配置文件

a.spark-env.sh

vi spark-env.sh

b.slaves

vi slaves

c.修改master ui端口(ambari占用8080端口所以修改,如果8080端口没有被占用不需要修改)
vi start-master.sh


修改成自定义的一个端口号
4.将修改后的conf目录复制到其他节点上
5.启动集群

也可以启动另外一个master
6.启动测试

7.test
/usr/local/apps/spark-2.2.0-bin-hadoop2.7/bin/spark-submit --class org.apache.spark.examples.SparkPi --master spark://node00:7077,node06:7077 --executor-memory 1G --total-executor-cores 2 /usr/local/apps/spark-2.2.0-bin-hadoop2.7/examples/jars/spark-examples_2.11-2.2.0.jar


