下载压缩包,并解压:http://spark.apache.org/downloads.html
配置环境
vi spark-env.sh
export JAVA_HOME=/home/lpp/Desktop/software/jdk1.8.0_73
#指定主节点
export SPARK_MASTER_HOME=HADOOP01
#指定主节点的端口,默认就是7077
export SPARK_MASTER_PORT=7077
vi slaves
#指定子节点
hadoop02
hadoop03
发送给其他的节点
scp -r spark-2.4.0-bin-hadoop2.6 lpp@hadoop03:$PWD
web界面:hadoop01:8080如下图:
搭建高可用:需要首先安装zookeeper
vi spark-env.sh
#url指定zk的地址,dir在zk的目录
export SPARK_DAEMON_JAVA_OPTS="-Dspark.deploy.recoveryMode=ZOOKEEPER -Dspark.deploy.zookeeper.url=hadoop01:2181,hadoop02,hadoop03 -Dspark.deploy.zookeeper.dir=/spark"
先启动zookeeper,然后在第一台上启动sbin/start-all.sh
然后在第二台上启动:sbin/start-master.sh
可以查看hadoop01:8080和hadoop02:8080