当前位置:网站首页>08 Spark cluster construction
08 Spark cluster construction
2022-08-01 16:35:00 【blue wind 9】
Foreword
Ha ha recently there are a series of related requirements for environment construction
Record it
spark three nodes: 192.168.110.150, 192.168.110.151, 192.168.110.152
150 is master, 151 is slave01, 152 is slave02
All three machines are trusted shell
spark version is spark-3.2.1-bin-hadoop2.7
Spark cluster setup
spark three nodes: 192.168.110.150, 192.168.110.151, 192.168.110.152
1. Basic environment preparation
Install jdk on 192.168.110.150, 192.168.110.151, 192.168.110.152, and upload the spark installation package
The installation package is from Downloads | Apache Spark
2. spark configuration adjustment
Copy the following three configuration files, make adjustments, and then scp to slave01, slave02 above
[email protected]:/usr/local/ProgramFiles/spark-3.2.1-bin-hadoop2.7# cp conf/spark-defaults.conf.template conf/[email protected]:/usr/local/ProgramFiles/spark-3.2.1-bin-hadoop2.7# cp conf/spark-env.sh.template conf/[email protected]:/usr/local/ProgramFiles/spark-3.2.1-bin-hadoop2.7# cp conf/workers.template conf/workers
Update workers
# A Spark Worker will be started on each of the machines listed below.slave01slave02
Update spark-defaults.conf
spark.master spark://master:7077# spark.eventLog.enabled true# spark.eventLog.dir hdfs://namenode:8021/directoryspark.serializer org.apache.spark.serializer.KryoSerializerspark.driver.memory 1g# spark.executor.extraJavaOptions -XX:+PrintGCDetails -Dkey=value -Dnumbers="one two three"
Update spark-env.sh
export JAVA_HOME=/usr/local/ProgramFiles/jdk1.8.0_291export HADOOP_HOME=/usr/local/ProgramFiles/hadoop-2.10.1export HADOOP_CONF_DIR=/usr/local/ProgramFiles/hadoop-2.10.1/etc/hadoopexport SPARK_DIST_CLASSPATH=$(/usr/local/ProgramFiles/hadoop-2.10.1/bin/hadoop classpath)export SPARK_MASTER_HOST=masterexport SPARK_MASTER_PORT=7077
3. Start the cluster
The machine where the master is located executes start-all.sh
[email protected]:/usr/local/ProgramFiles/spark-3.2.1-bin-hadoop2.7# ./sbin/start-all.shstarting org.apache.spark.deploy.master.Master, logging to /usr/local/ProgramFiles/spark-3.2.1-bin-hadoop2.7/logs/spark-root-org.apache.spark.deploy.master.Master-1-master.outslave01: starting org.apache.spark.deploy.worker.Worker, logging to /usr/local/ProgramFiles/spark-3.2.1-bin-hadoop2.7/logs/spark-root-org.apache.spark.deploy.worker.Worker-1-slave01.outslave02: starting org.apache.spark.deploy.worker.Worker, logging to /usr/local/ProgramFiles/spark-3.2.1-bin-hadoop2.7/logs/spa[email protected]master:/usr/local/ProgramFiles/spark-3.2.1-bin-hadoop2.7#
Test cluster
Submit 1000 iterations of SparkPI using spark-submit
spark-submit --class org.apache.spark.examples.SparkPi /usr/local/ProgramFiles/spark-3.2.1-bin-hadoop2.7/examples/jars/spark-examples_2.12-3.2.1.jar 1000
java driver submits spark task
spark web ui monitoring page
End
边栏推荐
- A full review of mainstream timed task solutions
- 1个月写900多条用例,2线城市年薪33W+的测试经理能有多卷?
- MLX90640 红外热成像仪测温模块开发笔记(完整版)
- PAT 甲级 A1030 Travel Plan
- Vulnhub靶机:HARRYPOTTER_ NAGINI
- HashCode technology insider interview must ask
- Meeting OA project (6) --- (to-be-opened meeting, historical meeting, all meetings)
- 测试技术|白盒测试以及代码覆盖率实践
- 美国弗吉尼亚大学、微软 | Active Data Pattern Extraction Attacks on Generative Language Models(对生成语言模型的主动数据模式提取攻击)
- Vulnhub target drone: HARRYPOTTER_ NAGINI
猜你喜欢
【Unity,C#】哨兵射线触发器模板代码
MUI 做手机返回操作栏
MySQL INTERVAL 关键字指南
MySQL's maximum recommended number of rows is 2000w, is it reliable?
如何有效地开发 Jmix 扩展组件
DOM series of touch screen events
Vulnhub靶机:HARRYPOTTER_ NAGINI
08 spark 集群搭建
Ali's official Redis development specification
Use Canvas to implement mobile phone signature
随机推荐
untiy Resorces目录动态加载资源
LeetCode第 303 场周赛
DevExpress的GridControl帮助类
今晚直播!
PHP 安全漏洞:会话劫持、跨站点脚本、SQL 注入以及如何修复它们
等变图神经网络在药物研发中大放异彩
PAT 甲级 A1003 Emergency
工业制造行业的低代码开发平台思维架构图
Description of common operations and help projects about DevExpress in C#
MySQL INTERVAL Keyword Guidelines
11 一发布就发布一系列系列
Chapter 13 Manually create a REST service (1)
网站备案后没有找到站点 您没有将此域名或IP绑定到对应站点! 配置文件未生效!
请问nacos 连接mysql失败后会重新连接吗?
[Dark Horse Morning Post] Hu Jun's endorsement of Wukong's financial management is suspected of fraud, which is suspected to involve 39 billion yuan; Fuling mustard responded that mustard ate toenails
提速!进口婴幼儿配方产品出证仅需1-3天
实习日报-2022-7-30
显示为弹出窗口是什么意思(电脑总是弹出广告)
在码云拉取代码后,调整了seata版本1.5.2。出现如下异常。是因为数据库表缺少字段导致的吗?
ESP8266-Arduino编程实例-MLX90614红外测温传感器驱动