下面的内容直接翻译自http://spark.apache.org/docs/latest/index.html
会有少量自己的扩展补充,当然理解或翻译上的问题,有错请指正,下面正式开始。
Spark Overview
Apache Spark是一个快速通用的集群计算系统。它提供了对Java、Scala、Python、R的高级API支持,一个支持一般执行图的优化引擎。同时它还支持许多高级工具,包括Spark SQL(sql&结构化数据处理), MLlib(机械学习),GraphX(图运算)和spark streaming
下载及安装
我们可以从Spark项目网站的下载页面(
http://spark.apache.org/downloads.html)得到spark。本系列文档中的内容都是基于Spark 1.5.2。Spark 使用了Hadoop client库来支持HDFS和YARN。在下载包中,预置了一些常用版本的Hadoop。我们也可以先下载任意版本的hadoop,然后通过配置Spark ClassPath
http://spark.apache.org/docs/latest/hadoop-provided.html 让Spark运行在任意版本的Hadoop上。
当然如果你喜欢自己通过源码自己build Spark,请参考
http://spark.apache.org/docs/latest/building-spark.html
Spark 能够运行在Windows和Unix(linux,Mac os 都行)环境下。在一台机器上本地运行也非常简单,只要安装了JAVA,并且正确设置了PATH和JAVA_PATH。
Spark需要运行在Java 7+,Python 2.6+,R3.1+。因为Spark 1.5.2 用了Scala 2.10 API,我们需要用2.10.x的Scala。
Examples
Spark 在examples/src/main目录下提供了Scala,Java,Python 和R的一些例子。
要运行 java或Scala 程序,可以在Spark 目录下执行 bin/run-example <class> [params]。(然后,它调用了更通用的 spark-submit 来启动应用)
例如
./bin/run-example SparkPi 10
我们也可以通过Scala Shell 来运行Spark。
./bin/spark-shell --master local[2]
--master 选项指定了分布式集群的master URL, 或者
local 表示本地单线程运行,
local[N]代表本地运行使用N个线程。在本地测试我们只能使用local。通过运行 Spark shell的
--help选项,能够得到所有的选项列表。
Spark也提供了Python API。可以通过 bin/pyspark来运行支持Python的Spark 交互程序。
./bin/pyspark --master local[2]
。同样Spark也提供了基于Python的例子。
./bin/spark-submit examples/src/main/python/pi.py 10
当然还有R
./bin/sparkR --master local[2]
./bin/spark-submit examples/src/main/r/dataframe.R
分享到:
相关推荐
Apache Spark是一个快速的、大规模的分布式计算系统,它提供了一个高层次的API,用Scala、Java、Python或R编写,能够在集群上运行。它具备内存计算的能力,可以比Hadoop MapReduce更快地执行批处理和迭代算法。Spark...
Spark Overview Apache Spark is a fast and general-purpose cluster computing system. It provides high-level APIs in Java, Scala and Python, and an optimized engine that supports general execution ...
Xiao Li and Wenchen Fan offer an overview of the major features and enhancements in Apache Spark 2.4. Along the way, you’ll learn about the design and implementation of V2 of theData Source API and ...
The book commences with an overview of the Spark eco-system. You will learn how to use MLlib to create a fully working neural ...
Overview 总体介绍 Job logical plan 介绍 job 的逻辑执行图(数据依赖图) Job physical plan 介绍 job 的物理执行图 Shuffle details 介绍 shuffle 过程 Architecture 介绍系统模块如何协调完成整个 job 的执行 ...
The book commences with an overview of the Spark ecosystem. It will introduce you to Project Tungsten and Catalyst, two of the major advancements of Apache Spark 2.x. You will understand how memory ...
首先,"SparkInternal1-Overview.pdf"应该是Spark的总体概述,它可能会介绍Spark的基本概念,如弹性分布式数据集(Resilient Distributed Datasets, RDDs)、DataFrame和Dataset,以及Spark的主要组件,如Spark Core...
Overview Big Data Analytics and its importance for organizations and data professionals. Delve into Spark to see how it is different from existing processing platforms Understand the intricacies of ...
Alpine Data Overview: Alpine Data 是一个数据科学平台,提供了从数据预处理到模型部署的一整套解决方案。该平台支持 Spark Autotuning,允许数据科学家们快速地开发和部署机器学习模型。 Spark Configuration:...
There is no better time to learn Spark than...This chapter provides a high-level overview of Spark, including the core concepts, the architecture, and the various components inside the Apache Spark stack
The book commences with an overview of the Spark eco-system. You will learn how to use MLlib to create a fully working neural ...
根据官方文档(http://spark.apache.org/docs/latest/cluster-overview.html),Spark支持多种集群管理器,包括Standalone、Apache Mesos以及Hadoop YARN。 **1.1 Standalone** - **定义**: Standalone是Spark自带...
Get a gentle overview of big data and Spark Learn about DataFrames, SQL, and Datasets-Spark's core APIs-through worked examples Dive into Spark's low-level APIs, RDDs, and execution of SQL and ...
Memory Usage Overview Spark 使用内存来缓存数据,以便在将来使用。这种缓存机制可以提高数据处理速度。在 Spark 中,内存主要用于三个方面:存储、执行和其他。其中,存储内存用于缓存数据,执行内存用于计算、...
Catalyst Optimizer: An Overview Catalyst 是 Spark SQL 的优化器,负责将用户查询转换为执行计划。Catalyst 优化器的目标是选择合适的执行计划,以最小化查询响应时间。Catalyst 优化器的主要组件包括: * ...
#### Hopsworks Platform Overview Hopsworks is a comprehensive data management and machine learning platform that simplies the deployment and management of Spark applications. Key components of ...
Spark GraphX in Action starts out with an overview of Apache Spark and the GraphX graph processing API. This example-based tutorial then teaches you how to configure GraphX and how to use it ...