Mirror of Apache Spark
Перейти к файлу
Matei Zaharia 8981804c71 Merge pull request #233 from rxin/dev
Fixed #232: DirectBuffer's cleaner was empty and Spark tried to invoke clean on it.
2012-10-01 14:30:39 -07:00
bagel/src Changed the way tasks' dependency files are sent to workers so that 2012-09-28 16:14:05 -07:00
bin Update license info on deploy scripts 2012-09-25 14:43:47 -07:00
conf Settings variables and bugfix for stop script. 2012-08-02 15:59:39 -07:00
core Fixed #232: DirectBuffer's cleaner was empty and Spark tried to invoke 2012-10-01 14:07:34 -07:00
docs Added mapPartitionsWithSplit to the programming guide. 2012-09-29 01:31:36 -07:00
ec2 Made region used by spark-ec2 configurable. 2012-08-28 22:40:00 -07:00
examples/src/main More updates to documentation 2012-09-25 19:31:07 -07:00
project Added a new command "pl" in sbt to publish to both Maven and Ivy. 2012-10-01 00:17:13 -07:00
repl Fixed several bugs that caused weird behavior with files in spark-shell: 2012-09-30 21:19:39 -07:00
sbt Echo off 2012-09-24 15:46:03 -07:00
.gitignore - Add docs/api to .gitignore 2012-09-16 15:28:52 -07:00
LICENSE Added BSD license 2010-12-07 10:32:17 -08:00
README.md Updated base README to point to documentation site instead of wiki, updated 2012-09-12 13:03:43 -07:00
kmeans_data.txt Fixed bugs 2012-01-09 11:59:52 -08:00
lr_data.txt Test commit 2012-02-06 09:58:06 -08:00
run Update Scala version dependency to 2.9.2 2012-09-24 14:12:48 -07:00
run.cmd Add spark-shell.cmd 2012-09-25 07:26:29 -07:00
run2.cmd Windows command scripts for sbt and run 2012-09-24 15:43:19 -07:00
spark-executor Further refactoring, and start of a standalone scheduler backend 2012-07-06 17:56:44 -07:00
spark-shell More work to allow Spark to run on the standalone deploy cluster. 2012-07-08 14:00:04 -07:00
spark-shell.cmd Add spark-shell.cmd 2012-09-25 07:26:29 -07:00

README.md

Spark

Lightning-Fast Cluster Computing - http://www.spark-project.org/

Online Documentation

You can find the latest Spark documentation, including a programming guide, on the project webpage at http://spark-project.org/documentation.html. This README file only contains basic setup instructions.

Building

Spark requires Scala 2.9.1. This version has been tested with 2.9.1.final.

The project is built using Simple Build Tool (SBT), which is packaged with it. To build Spark and its example programs, run:

sbt/sbt compile

To run Spark, you will need to have Scala's bin in your PATH, or you will need to set the SCALA_HOME environment variable to point to where you've installed Scala. Scala must be accessible through one of these methods on Mesos slave nodes as well as on the master.

To run one of the examples, use ./run <class> <params>. For example:

./run spark.examples.SparkLR local[2]

will run the Logistic Regression example locally on 2 CPUs.

Each of the example programs prints usage help if no params are given.

All of the Spark samples take a <host> parameter that is the Mesos master to connect to. This can be a Mesos URL, or "local" to run locally with one thread, or "local[N]" to run locally with N threads.

A Note About Hadoop

Spark uses the Hadoop core library to talk to HDFS and other Hadoop-supported storage systems. Because the HDFS API has changed in different versions of Hadoop, you must build Spark against the same version that your cluster runs. You can change the version by setting the HADOOP_VERSION variable at the top of project/SparkBuild.scala, then rebuilding Spark.

Configuration

Spark can be configured through two files: conf/java-opts and conf/spark-env.sh.

In java-opts, you can add flags to be passed to the JVM when running Spark.

In spark-env.sh, you can set any environment variables you wish to be available when running Spark programs, such as PATH, SCALA_HOME, etc. There are also several Spark-specific variables you can set:

  • SPARK_CLASSPATH: Extra entries to be added to the classpath, separated by ":".

  • SPARK_MEM: Memory for Spark to use, in the format used by java's -Xmx option (for example, -Xmx200m means 200 MB, -Xmx1g means 1 GB, etc).

  • SPARK_LIBRARY_PATH: Extra entries to add to java.library.path for locating shared libraries.

  • SPARK_JAVA_OPTS: Extra options to pass to JVM.

  • MESOS_NATIVE_LIBRARY: Your Mesos library, if you want to run on a Mesos cluster. For example, this might be /usr/local/lib/libmesos.so on Linux.

Note that spark-env.sh must be a shell script (it must be executable and start with a #! header to specify the shell to use).