大规模数据处理Apache Spark开发
大規模數據處理Apache Spark開發
Spark是用于大規模數據處理的統一分析引擎。它提供了Scala、Java、Python和R的高級api,以及一個支持用于數據分析的通用計算圖的優化引擎。它還支持一組豐富的高級工具,包括用于SQL和DataFrames的Spark
SQL、用于機器學習的MLlib、用于圖形處理的GraphX以及用于流處理的結構化流。
https://github.com/apache/spark
https://spark.apache.org/
Online Documentation
可以在project web頁面上找到最新的Spark文檔,包括編程指南。此readme文件僅包含基本的安裝說明。
Building Spark
Spark是使用Apache Maven構建的。要構建Spark及其示例程序,請運行:
./build/mvn -DskipTests clean package
(如果下載了預構建包,則無需執行此操作。)
更詳細的文件可從項目現場“Building Spark”獲取。
有關一般開發技巧,包括使用IDE開發Spark的信息,請參閱"Useful Developer Tools"。
Interactive Scala Shell
The easiest way to start using Spark is through the Scala
shell: ./bin/spark-shell
Try the following command, which should return
1,000,000,000:
scala> spark.range(1000* 1000 * 1000).count()
Interactive Python Shell
Alternatively, if you prefer Python, you can use the
Python shell: ./bin/pyspark
And run the following command, which should also return
1,000,000,000:
spark.range(1000 * 1000 * 1000).count()
Spark also comes with
several sample programs in the examples directory. To run one of them, use ./bin/run-example [params]. For example:
./bin/run-example SparkPi will run the Pi example locally.
You can set the MASTER environment variable when running examples to submit examples to a cluster. This can be a mesos:// or spark:// URL, “yarn” to run on YARN, and “local” to run locally with one thread, or “local[N]” to run locally with N threads. You can also use an abbreviated class name if the class is in the examples package. For instance:
MASTER=spark://host:7077 ./bin/run-example SparkPi Many of the example programs print usage help if no params are given.
Running Tests
Testing first requires building Spark.
Once Spark is built, tests can be run using:
./dev/run-tests
Please see the guidance on how to run tests for a module, or individual tests.
There is also a Kubernetes integration test, see
resource-managers/kubernetes/integration tests/README.md
關于Hadoop版本的說明
Spark使用Hadoop核心庫與HDFS和其他Hadoop支持的存儲系統進行通信。由于協議在不同版本的Hadoop中發生了變化,因此必須針對集群運行的同一版本構建Spark。
請參閱構建文檔"Specifying the Hadoop Version and Enabling YARN",以獲取構建特定Hadoop發行版的詳細指導,包括為特定的配置單元和配置單元節儉服務器發行版構建。
配置
有關如何配置Spark的概述,請參閱聯機文檔中的配置指南。
貢獻
請查閱Spark指南,以了解如何開始為項目作出貢獻。
A Note About Hadoop Versions
Spark uses the Hadoop core library to talk to HDFS and other Hadoop-supported storage systems. Because the protocols have changed in
different versions of Hadoop, you must build Spark against the same version that your cluster runs.
Please refer to the build documentation at “Specifying the Hadoop Version and Enabling YARN” for detailed guidance on building for a particular distribution of Hadoop, including building for particular Hive and Hive Thriftserver distributions.
Configuration
Please refer to the Configuration Guide in the online documentation for an overview on how to configure Spark.
Contributing
Please review the Contribution to Spark guide
for information on how to get started contributing to the project.
總結
以上是生活随笔為你收集整理的大规模数据处理Apache Spark开发的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 算法编程Algos Programmin
- 下一篇: TensorRT 基于Yolov3的开发