Spark 2.4.0 standalone 模式安装

Spark 2.4.0 standalone 模式安装

视频

<iframe width="800" height="500" src="//player.bilibili.com/player.html?aid=38193405&cid=67137841&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>

更多资源

官网文档

技能标签

  • 学会安装Spark 2.4.0 standalone模式环境安装
  • Spark 集群环境maste,worker,history server 启动停止命令
  • Spark master,worker,history server 配置和管理界面查看
  • Spark shell 终端执行交互式命令,Spark shell 作业监控
  • WorldCount案例运行,界面查看
  • Spark master,worker,history,executor 日志查看
  • 官网: http://spark.apache.org/docs/latest/spark-standalone.html

前置条件

  • 已安装好java(选用的是java 1.8.0_191)
  • 已安装好scala(选用的是scala 2.11.121)
  • 已安装好hadoop(选用的是Hadoop 3.1.1)

安装

tar -zxvf spark-2.4.0-bin-without-hadoop.tgz -C /opt/module/bigdata/
  • 配置环境变量(配的是~/.bashrc)
export JAVA_HOME=/opt/module/jdk/jdk1.8.0_191
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export SCALA_HOME=/opt/module/scala/scala-2.11.12
export HADOOP_HOME=/opt/module/bigdata/hadoop-3.1.1
export SPARK_HOME=/opt/module/bigdata/spark-2.4.0-bin-without-hadoop
export PATH=$JAVA_HOME/bin:$SCALA_HOME/bin:$SPARK_HOME/bin:$SPARK_HOME/sbin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$PATH


配置

配置hadoop的classpath

  • 下载不带hadoop依赖jar的spark版本
  • 需要在spark配置中指定hadoop的classpath
  • 配置文件spark-env.sh
### in conf/spark-env.sh ###

# If 'hadoop' binary is on your PATH
export SPARK_DIST_CLASSPATH=$(hadoop classpath)

# With explicit path to 'hadoop' binary
export SPARK_DIST_CLASSPATH=$(/path/to/hadoop/bin/hadoop classpath)

# Passing a Hadoop configuration directory
export SPARK_DIST_CLASSPATH=$(hadoop --config /path/to/configs classpath)

spark-env.sh配置

#!/usr/bin/env bash





#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# This file is sourced when running various Spark programs.
# Copy it as spark-env.sh and edit that to configure Spark for your site.

# Options read when launching programs locally with
# ./bin/run-example or ./bin/spark-submit
# - HADOOP_CONF_DIR, to point Spark towards Hadoop configuration files
# - SPARK_LOCAL_IP, to set the IP address Spark binds to on this node
# - SPARK_PUBLIC_DNS, to set the public dns name of the driver program

# Options read by executors and drivers running inside the cluster
# - SPARK_LOCAL_IP, to set the IP address Spark binds to on this node
# - SPARK_PUBLIC_DNS, to set the public DNS name of the driver program
# - SPARK_LOCAL_DIRS, storage directories to use on this node for shuffle and RDD data
# - MESOS_NATIVE_JAVA_LIBRARY, to point to your libmesos.so if you use Mesos

# Options read in YARN client/cluster mode
# - SPARK_CONF_DIR, Alternate conf dir. (Default: ${SPARK_HOME}/conf)
# - HADOOP_CONF_DIR, to point Spark towards Hadoop configuration files
# - YARN_CONF_DIR, to point Spark towards YARN configuration files when you use YARN
# - SPARK_EXECUTOR_CORES, Number of cores for the executors (Default: 1).
# - SPARK_EXECUTOR_MEMORY, Memory per Executor (e.g. 1000M, 2G) (Default: 1G)
# - SPARK_DRIVER_MEMORY, Memory for Driver (e.g. 1000M, 2G) (Default: 1G)

# Options for the daemons used in the standalone deploy mode
# - SPARK_MASTER_HOST, to bind the master to a different IP address or hostname
# - SPARK_MASTER_PORT / SPARK_MASTER_WEBUI_PORT, to use non-default ports for the master
# - SPARK_MASTER_OPTS, to set config properties only for the master (e.g. "-Dx=y")
# - SPARK_WORKER_CORES, to set the number of cores to use on this machine
# - SPARK_WORKER_MEMORY, to set how much total memory workers have to give executors (e.g. 1000m, 2g)
# - SPARK_WORKER_PORT / SPARK_WORKER_WEBUI_PORT, to use non-default ports for the worker
# - SPARK_WORKER_DIR, to set the working directory of worker processes
# - SPARK_WORKER_OPTS, to set config properties only for the worker (e.g. "-Dx=y")
# - SPARK_DAEMON_MEMORY, to allocate to the master, worker and history server themselves (default: 1g).
# - SPARK_HISTORY_OPTS, to set config properties only for the history server (e.g. "-Dx=y")
# - SPARK_SHUFFLE_OPTS, to set config properties only for the external shuffle service (e.g. "-Dx=y")
# - SPARK_DAEMON_JAVA_OPTS, to set config properties for all daemons (e.g. "-Dx=y")
# - SPARK_DAEMON_CLASSPATH, to set the classpath for all daemons
# - SPARK_PUBLIC_DNS, to set the public dns name of the master or workers

# Generic options for the daemons used in the standalone deploy mode
# - SPARK_CONF_DIR      Alternate conf dir. (Default: ${SPARK_HOME}/conf)
# - SPARK_LOG_DIR       Where log files are stored.  (Default: ${SPARK_HOME}/logs)
# - SPARK_PID_DIR       Where the pid file is stored. (Default: /tmp)
# - SPARK_IDENT_STRING  A string representing this instance of spark. (Default: $USER)
# - SPARK_NICENESS      The scheduling priority for daemons. (Default: 0)
# - SPARK_NO_DAEMONIZE  Run the proposed command in the foreground. It will not output a PID file.
# Options for native BLAS, like Intel MKL, OpenBLAS, and so on.
# You might get better performance to enable these options if using native BLAS (see SPARK-21305).
# - MKL_NUM_THREADS=1        Disable multi-threading of Intel MKL
# - OPENBLAS_NUM_THREADS=1   Disable multi-threading of OpenBLAS



# Passing a Hadoop configuration directory
export SPARK_DIST_CLASSPATH=$(hadoop classpath)

#master setting
SPARK_MASTER_HOST=standalone.com  #绑定master的主机域名
SPARK_MASTER_PORT=7077            # master 通信端口,worker和master通信端口
SPARK_MASTER_WEBUI_PORT=8080      # master SParkUI用的端口


# worker setting

SPARK_WORKER_MEMORY=1g  #配置worker的内存大小

slaves配置

  • 配置路径$SPARK_HOME/conf/slaves
standalone.com

history server 配置

  • 配置 $SPARK_HOME/conf/spark-defaults.conf
  • 注意spark.eventLog.dir 和spark.history.fs.logDirectory 要相同路径

#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Default system properties included when running spark-submit.
# This is useful for setting default environmental settings.

# Example:
# spark.master                     spark://master:7077
# spark.eventLog.enabled           true
# spark.eventLog.dir               hdfs://namenode:8021/directory
# spark.serializer                 org.apache.spark.serializer.KryoSerializer
# spark.driver.memory              5g
# spark.executor.extraJavaOptions  -XX:+PrintGCDetails -Dkey=value -Dnumbers="one two three"



# history 
spark.master=spark://standalone.com:7077
spark.eventLog.enabled=true
spark.eventLog.dir=hdfs://standalone.com:9000/spark/log/historyEventLog
spark.serializer=org.apache.spark.serializer.KryoSerializer
spark.driver.memory=1g
spark.history.fs.logDirectory=hdfs://standalone.com:9000/spark/log/historyEventLog

spark.history.ui.port=18080
spark.history.fs.update.interval=10s
#	The number of application UIs to retain. If this cap is exceeded, then the oldest applications will be removed.
spark.history.retainedApplications=50
spark.history.fs.cleaner.enabled=false
spark.history.fs.cleaner.interval=1d
spark.history.fs.cleaner.maxAge=7d
spark.history.ui.acls.enable=false

master

master启动命令

  • 默认master日志路径 $SPARK_HOME/logs/--org.apache.spark.deploy.master.Master--.out
start-master.sh

master停止命令

stop-master.sh

worker

master启动命令

  • 默认worker日志路径 $SPARK_HOME/logs/--org.apache.spark.deploy.master.Worker--.out
 start-slave.sh spark://standalone.com:7077

worker停止命令

 stop-slave.sh 

启动所有worker命令

  • 配置 $SPARK_HOME/conf/slaves 所有worker配置
 start-slaves.sh spark://standalone.com:7077

停止所有worker命令

 stop-slaves.sh 

启动spark-shell命令

 spark-shell

启动history-server命令

 start-history-server.sh 

停上history-server 命令

 stop-history-server.sh 

管理控制台

master控制台

spark-shell命令

  • 终端交互界面

end

转载于:https://my.oschina.net/u/723009/blog/2988798

等保三级-MySQL 安全加固实战指南 本文详细介绍了MySQL数据库在等保三级要求下的安全加固实战指南,涵盖身份鉴别、访问控制、安全审计、网络传输安全、入侵防范和数据完整性等关键领域。通过具体配置示例和实战经验,帮助用户有效提升MySQL数据库的安全防护能力,满足等保三级合规要求。 阅读详情

相关推荐

Unity 实战项目 ☀️| 只用一个脚本做一个 刮刮乐 案例,一不小心刮出来一个女朋友!【学习娱乐一下】

只用一个脚本做一个刮刮乐,一不小心刮出来一个女朋友!【学习娱乐一下!】

努力前行,总会成为自己心中的那道光 23万+

Linux下安装Spark

目录一、环境二、先安装jdk三、下载spark-2.4.0-bin-hadoop2.7四、上传&安装五、配置1. 配置spark-env.sh2. 配置slaves六、启动&停止七、访问 一、环境 本文所用Linux版本为CentOS 7 二、先安装jdk 这是安装JDK的详细步骤: https://blog.csdn.net/cherlshall/article/details/88974325 三、下载spark-2.4.0-bin-hadoop2.7 官网下载页面:http://s

heartsdance的博客 3012

spark-2.4.0-bin-hadoop2.7.rar

spark-2.4.0-bin-hadoop2.7 ,下载超级慢,放在这里分享给大家.. 加压rar就可以

Sparkspark2.4.0安装

软件准备:Index of /dist/spark,选择跟hadoop集成的版本 1,解压:tar -zxvf spark-2.4.0-bin-hadoop2.6.tgz mv spark-2.4.0-bin-hadoop2.6 spark vim /etc/profile.d/bigdata-etc.sh export SPARK_HOME=/opt/spark export PATH=$PATH:$SPARK_HOME/bin:$S......

Joseph25的博客 1517

linux下spark安装流程

linux下spark安装流程

qq_60142726的博客 648

Spark安装和编程实践(Spark2.4.0

下载安装包 修改配置文件 spark-env.sh文件(vim ./conf/spark-env.sh),在第一行添加以下配置信息: 配置完成后就可以直接使用,不需要像Hadoop运行启动命令 spark创建sc,可以加载本地文件和HDFS文件创建RDD。这里用Spark自带的本地文件README.md文件测试。 简单RDD操作 组合RDD操作进行组合,可以实现简易MapReduce操作 独立应用程序编程 (一)使用sbt对Scala独立应用程序进行编译打包 1. 安装sbt 把sbt安装到“/us

weixin_55089394的博客 914

Spark 2.4 standalone 部署

1 安装 Spark 使用如下命令下载 Spark,下载地址: wget http://mirrors.hust.edu.cn/apache/spark/spark-2.4.0/spark-2.4.0-bin-hadoop2.7.tgz 解压 tgz 包: tar zxvf spark-2.4.0-bin-hadoop2.7.tgz 修改环境变量并声明: vim ~/.bashrc export...

weixin_34010949的博客 227

spark2.4.0 伪分布式集群搭建 mac环境

一、官网文档 https://spark.apache.org/docs/2.4.0/spark-standalone.html 二、技能标签 - 学会安装Spark 2.4.0 standalone模式环境安装 - Spark 集群环境maste,worker,history server 启动停止命令 - Spark master,worker,history server 配置和管理界面查看 - Spark shell 终端执行交互式命令,Spark shell 作业监控 - World.

大黄_sama 502

Spark 2.4.0 三节点集群部署文档 (Standalone 模式)

本文档详细介绍了Spark 2.4.0三节点集群(Standalone模式)的部署流程。规划使用三台服务器(10.8.16.213/209/210),其中213节点同时作为Master和Worker。部署过程包括:环境准备(JDK8安装、hosts配置、SSH免密)、Spark软件安装配置(环境变量、spark-env.sh和slaves文件修改)、集群启停操作及验证测试。特别注意了与Flink集群的端口冲突问题,提供了完整的配置参数和验证方法。通过运行SparkPi示例程序成功验证集群功能。

m0_74880098的博客 1102

Hadoop2.6.0+Spark1.4.0集群安装

1,要求你已经成功把Hadoop集群安装完毕,并经过测试,如果不知道如何编译安装Hadoop请参考散仙的这篇文章[url]http://qindongliang.iteye.com/blog/2222145[/url] 2安装Scala2.10.x版本,spark1.4.0最新版本的兼容2.10.x的scala,建议还是安装scala2.10.x的,虽然scala最新的版本是2.11.x了...

三劫散仙 150

Spark 2.4.0 集成Hive 1.2.1

Spark 2.4.0 集成Hive 1.2.1 更多资源 github: https://github.com/opensourceteams/spark-scala-maven-2.4.0 apache-hive-1.2.1-bin 安装: https://github.com/open...

chongqueluo2709的博客 1264

spark-2.4.0-bin-without-hadoop.tar下载

百度网盘: 链接:https://pan.baidu.com/s/19X6iqi5eZiEEoTG3fjwYtA 提取码:l67b

weixin_42158422的博客 2254

spark各个版本下载

http://www.apache.org/dist/spark

杜海的博客 6647

KeyarchOS安装Spark2.4.0

查看日志:tail logs/spark-root-org.apache.spark.deploy.master.Master-1-localhost.localdomain.out。查看日志:tail logs/spark-root-org.apache.spark.deploy.worker.Worker-1-localhost.localdomain.out。启动spark-master:./sbin/start-master.sh。添加图片注释,不超过 140 字(可选)

ITer_szlgz的博客 853

NIKON尼康单反相机快门修改工具

尼康单反相机快门清零,修改,软件,今天给大家放出来哈。你想改多少次就改多少次。

上一篇: Hadoop 3.1.1伪分布式模式安装
下一篇: [英译中]Spark2.4.0官网编程指南之快速入门
chongqueluo2709
博客等级 码龄10年 0粉丝 0原创
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值