正文
下载Spark版本,这版本又要求必须和jdk与hadoop版本对应。
tar -zxvf 解压到指定目录,进入conf进行培训。spark-env.sh.template 改为 spark-env.sh,注册
export SPARK_DAEMON_JAVA_OPTS="-Dspark.deploy.recoveryMode=ZOOKEEPER -Dspark.deploy.zookeeper.url=hp01:2181,hp02:
2181,hp03:2181 -Dspark.deploy.zookeeper.dir=/spark"
JAVA_HOME也要配置,其实环境变量已经配了,如果此不配在运行sh中脚本会走这个变量,没有找到就会报 JAVA_HOME没有set的问题。上面的配置是连接zookeeper,配置问了修改slaves.template 改为slaves,添加子节点也就是worker。只需要这几步,完成以后将安装包发送到各个worker节点。启动当前的master节点。进而所有的worker都会启动起来。如果要启动另一个master节点,单独去那个节点去启动start-master.sh。通过浏览器访问两个主节点就可以看出区别。状态Status。这样也就完成了简单的一个HA搭建。
- URL: spark://hadoop01:9090
- REST URL: spark://hadoop01:6066 (cluster mode)
- Alive Workers: 3
- Cores in use: 3 Total, 0 Used
- Memory in use: 3.0 GB Total, 0.0 B Used
- Applications: 0 Running, 0 Completed
- Drivers: 0 Running, 0 Completed
- Status: ALIVE
===========================================================================================
===========================================================================================
===========================================================================================
- URL: spark://hadoop02:9090
- REST URL: spark://hadoop02:6066 (cluster mode)
- Alive Workers: 0
- Cores in use: 0 Total, 0 Used
- Memory in use: 0.0 B Total, 0.0 B Used
- Applications: 0 Running, 0 Completed
- Drivers: 0 Running, 0 Completed
- Status: STANDBY
总结
刚接触spark不久如果有什么不对的地方,希望大神们对对指点。同时自己也最近一段时间,也在寻找大数据开发的工作如果有需要的可以联系本人。qq653530273,