Step 1:
可以尝试先搭建伪分布式,然后完全分布式只是在这个基础上做了一些修改而已
http://blog.csdn.net/ymf827311945/article/details/73733916
Step 2:
在node11节点上执行命令:
vi /opt/apps/spark/spark-1.6.0-bin-hadoop2.6/conf/spark-env.sh
添加如下属性:
export SPARK_DAEMON_JAVA_OPTS="-Dspark.deploy.recoveryMode=ZOOKEEPER -Dspark.deploy.zookeeper.url=node11:2181,node12:2181,node13:2181"
Step 3:
执行命令:
scp /opt/apps/spark/spark-1.6.0-bin-hadoop2.6/conf/spark-env.sh node12:/opt/apps/spark/spark-1.6.0-bin-hadoop2.6/conf/spark-env.sh
scp /opt/apps/spark/spark-1.6.0-bin-hadoop2.6/conf/spark-env.sh node13:/opt/apps/spark/spark-1.6.0-bin-hadoop2.6/conf/spark-env.sh
Step 4:
找一个节点执行命令——backup
vi /opt/apps/spark/spark-1.6.0-bin-hadoop2.6/conf/spark-env.sh
修改属性:—将节点修改成当前节点作为backup
export SPARK_MASTER_IP=node12
Step 5:
在三个节点执行命令,启动zookeeper
zkServer.sh start
zkServer.sh status
Step 6:
在node11节点上执行命令:
start-all.sh
在node12节点上执行命令:
yarn-daemon.sh start resourcemanager
Step 7:
打开浏览器,输入URL进行查看
http://192.168.80.11:50070/dfshealth.html#tab-overview
http://192.168.80.12:50070/dfshealth.html#tab-overview
Yarn
http://192.168.80.11:8088/cluster
http://192.168.80.12:8088/
Step 8:
在node11节点上执行命令,启动spark
cd /opt/apps/spark/spark-1.6.0-bin-hadoop2.6
./sbin/start-all.sh
在选择的backup节点上执行命令:
cd /opt/apps/spark/spark-1.6.0-bin-hadoop2.6
./sbin/start-master.sh
Step 9:
打开浏览器,输入URL进行查看—–node11:alive状态 node12:standby状态
http://192.168.80.11:8080/
http://192.168.80.12:8080/
Step 10:
在node11节点上执行命令,杀死Master进程,然后重新启动Master
Step 11:
重新打开浏览器,进行查看——-Node11:standby状态 Node12:alive状态
http://192.168.80.11:8080/
http://192.168.80.12:8080/
Step 12:
在node11节点上执行命令,进入zookeeper查看是否leader选举的信息被写入
zkCli.sh
ls /spark/leader_election