Mirror of Apache Spark
Switch branches/tags
v0.9.0-incubating v0.8.1-incubating v0.8.0-incubating v0.8.0-incubating-rc3 v0.7.2 v0.7.1 v0.7.0 v0.7.0-bizo-1 v0.6.2 v0.6.1 v0.6.0 v0.6.0-yarn v0.5.2 v0.5.1 v0.5.0 spark2-2.3.0-cloudera4 spark2-2.3.0-cloudera3 spark2-2.3.0-cloudera2 spark2-2.3.0-cloudera1 spark2-2.2.0-cloudera4 spark2-2.2.0-cloudera3 spark2-2.2.0-cloudera2 spark2-2.2.0-cloudera1 spark2-2.1.0-cloudera3 spark2-2.1.0-cloudera2 spark2-2.1.0-cloudera1 spark2-2.0.0-cloudera2 spark2-2.0.0-cloudera1 spark2-2.0.0-beta2 spark2-2.0.0-beta1 spark-parent-0.8.1-incubating cdh6.0.1-release cdh6.0.0-release cdh5.16.0-release cdh5.15.1-release cdh5.15.0-release cdh5.14.4-release cdh5.14.2-release cdh5.14.0-release cdh5.13.3-release cdh5.13.2-release cdh5.13.1-release cdh5.13.0-release cdh5.12.2-release cdh5.12.1-release cdh5.12.0-release cdh5.11.2-release cdh5.11.1-release cdh5.11.0-release cdh5.10.2-release cdh5.10.1-release cdh5.10.0-release cdh5.9.3-release cdh5.9.2-release cdh5.9.1-release cdh5.9.0-release cdh5.8.5-release cdh5.8.4-release cdh5.8.3-release cdh5.8.2-release cdh5.8.0-release cdh5.7.6-release cdh5.7.5-release cdh5.7.4-release cdh5.7.3-release cdh5.7.2-release cdh5.7.1-release cdh5.7.0-release cdh5.6.1-release cdh5.6.0-release cdh5.5.6-release cdh5.5.5-release cdh5.5.4-release cdh5.5.2-release cdh5.5.1-release cdh5.5.0-release cdh5.4.11-release cdh5.4.10-release cdh5.4.9-release cdh5.4.8-release cdh5.4.7-release cdh5.4.5-release cdh5.4.4-release cdh5.4.3-release cdh5.4.2-release cdh5.4.1-release cdh5.4.0-release cdh5.3.10-release cdh5.3.9-release cdh5.3.8-release cdh5.3.6-release cdh5.3.5-release cdh5.3.4-release cdh5.3.3-release cdh5.3.2-release cdh5.3.1-release cdh5.3.0-release cdh5.2.6-release cdh5.2.5-release cdh5.2.4-release
Nothing to show
Clone or download
Pull request Compare This branch is 3444 commits ahead of baeeq:master.
CodingCat and rxin Merge pull request #556 from CodingCat/JettyUtil. Closes #556.
[SPARK-1060] startJettyServer should explicitly use IP information

https://spark-project.atlassian.net/browse/SPARK-1060

In the current implementation, the webserver in Master/Worker is started with

val (srv, bPort) = JettyUtils.startJettyServer("0.0.0.0", port, handlers)

inside startJettyServer:

val server = new Server(currentPort) //here, the Server will take "0.0.0.0" as the hostname, i.e. will always bind to the IP address of the first NIC

this can cause wrong IP binding, e.g. if the host has two NICs, N1 and N2, the user specify the SPARK_LOCAL_IP as the N2's IP address, however, when starting the web server, for the reason stated above, it will always bind to the N1's address

Author: CodingCat <zhunansjtu@gmail.com>

== Merge branch commits ==

commit 6c6d9a8
Author: CodingCat <zhunansjtu@gmail.com>
Date:   Thu Feb 6 14:53:34 2014 -0500

    startJettyServer should explicitly use IP information
Latest commit b6dba10 Feb 9, 2014
Permalink
Failed to load latest commit information.
assembly Merge pull request #542 from markhamstra/versionBump. Closes #542. Feb 9, 2014
bagel Merge pull request #542 from markhamstra/versionBump. Closes #542. Feb 9, 2014
bin Merge pull request #534 from sslavic/patch-1. Closes #534. Feb 4, 2014
conf Make DEBUG-level logs consummable. Jan 10, 2014
core Merge pull request #556 from CodingCat/JettyUtil. Closes #556. Feb 9, 2014
data moved user scripts to bin folder Sep 23, 2013
dev Merge pull request #565 from pwendell/dev-scripts. Closes #565. Feb 9, 2014
docker A little revise for the document Oct 28, 2013
docs Merge pull request #542 from markhamstra/versionBump. Closes #542. Feb 9, 2014
ec2 Add i2 instance types to Spark EC2. Jan 10, 2014
examples Merge pull request #542 from markhamstra/versionBump. Closes #542. Feb 9, 2014
external Merge pull request #542 from markhamstra/versionBump. Closes #542. Feb 9, 2014
graphx Merge pull request #542 from markhamstra/versionBump. Closes #542. Feb 9, 2014
mllib Merge pull request #542 from markhamstra/versionBump. Closes #542. Feb 9, 2014
project Merge pull request #542 from markhamstra/versionBump. Closes #542. Feb 9, 2014
python Merge pull request #562 from jyotiska/master. Closes #562. Feb 9, 2014
repl Merge pull request #542 from markhamstra/versionBump. Closes #542. Feb 9, 2014
sbin Update stop-slaves.sh Jan 7, 2014
sbt Merge pull request #454 from jey/atomic-sbt-download. Closes #454. Feb 8, 2014
streaming Merge pull request #542 from markhamstra/versionBump. Closes #542. Feb 9, 2014
tools Merge pull request #542 from markhamstra/versionBump. Closes #542. Feb 9, 2014
yarn Merge pull request #542 from markhamstra/versionBump. Closes #542. Feb 9, 2014
.gitignore Restricting /lib to top level directory in .gitignore Jan 21, 2014
LICENSE Updated LICENSE with third-party licenses Sep 2, 2013
NOTICE Add Apache license headers and LICENSE and NOTICE files Jul 17, 2013
README.md Remove GraphX README Jan 9, 2014
make-distribution.sh fix make-distribution.sh show version: command not found Jan 8, 2014
pom.xml Merge pull request #542 from markhamstra/versionBump. Closes #542. Feb 9, 2014

README.md

Apache Spark

Lightning-Fast Cluster Computing - http://spark.incubator.apache.org/

Online Documentation

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

Building

Spark requires Scala 2.10. The project is built using Simple Build Tool (SBT), which can be obtained here. If SBT is installed we will use the system version of sbt otherwise we will attempt to download it automatically. To build Spark and its example programs, run:

./sbt/sbt assembly

Once you've built Spark, the easiest way to start using it is the shell:

./bin/spark-shell

Or, for the Python API, the Python shell (./bin/pyspark).

Spark also comes with several sample programs in the examples directory. To run one of them, use ./bin/run-example <class> <params>. For example:

./bin/run-example org.apache.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 <master> parameter that is the cluster URL to connect to. This can be a mesos:// or spark:// URL, or "local" to run locally with one thread, or "local[N]" to run locally with N threads.

Running tests

Testing first requires Building Spark. Once Spark is built, tests can be run using:

./sbt/sbt test

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. You can change the version by setting the SPARK_HADOOP_VERSION environment when building Spark.

For Apache Hadoop versions 1.x, Cloudera CDH MRv1, and other Hadoop versions without YARN, use:

# Apache Hadoop 1.2.1
$ SPARK_HADOOP_VERSION=1.2.1 sbt/sbt assembly

# Cloudera CDH 4.2.0 with MapReduce v1
$ SPARK_HADOOP_VERSION=2.0.0-mr1-cdh4.2.0 sbt/sbt assembly

For Apache Hadoop 2.2.X, 2.1.X, 2.0.X, 0.23.x, Cloudera CDH MRv2, and other Hadoop versions with YARN, also set SPARK_YARN=true:

# Apache Hadoop 2.0.5-alpha
$ SPARK_HADOOP_VERSION=2.0.5-alpha SPARK_YARN=true sbt/sbt assembly

# Cloudera CDH 4.2.0 with MapReduce v2
$ SPARK_HADOOP_VERSION=2.0.0-cdh4.2.0 SPARK_YARN=true sbt/sbt assembly

# Apache Hadoop 2.2.X and newer
$ SPARK_HADOOP_VERSION=2.2.0 SPARK_YARN=true sbt/sbt assembly

When developing a Spark application, specify the Hadoop version by adding the "hadoop-client" artifact to your project's dependencies. For example, if you're using Hadoop 1.2.1 and build your application using SBT, add this entry to libraryDependencies:

"org.apache.hadoop" % "hadoop-client" % "1.2.1"

If your project is built with Maven, add this to your POM file's <dependencies> section:

<dependency>
  <groupId>org.apache.hadoop</groupId>
  <artifactId>hadoop-client</artifactId>
  <version>1.2.1</version>
</dependency>

Configuration

Please refer to the Configuration guide in the online documentation for an overview on how to configure Spark.

Apache Incubator Notice

Apache Spark is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.

Contributing to Spark

Contributions via GitHub pull requests are gladly accepted from their original author. Along with any pull requests, please state that the contribution is your original work and that you license the work to the project under the project's open source license. Whether or not you state this explicitly, by submitting any copyrighted material via pull request, email, or other means you agree to license the material under the project's open source license and warrant that you have the legal authority to do so.