2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Run Apache Spark on Mac

Last updated at Posted at 2015-06-24

一見敷居が高そうなBig data frame work Apache Sparkを試してみました。とてもSparkの実行は簡単です。

Spark version

1.4.0

Download binary file

$ wget http://www.apache.org/dyn/closer.cgi/spark/spark-1.4.0/spark-1.4.0.tgz
$ tar zxvf spark-1.4.0-bin-hadoop2.6.tgz

Run examples

Scala

$ cd spark-1.4.0-bin-hadoop2.6
$ ./bin/run-example SparkPi

Sparkの例はGithubにあり、なかにどうのように実行すればいいか書いてある場合があるので、なにか動かしたいひとはとりあえず例をみる。もしくは、パッケージと対応しているのでパッケージのパスをrun-exampleに渡す。

$ ./bin/run-example org.apache.spark.examples.mllib.Correlations

Python

$ ./bin/spark-submit examples/src/main/python/pi.py

Pythonの場合であれば、spark-submitを使う。同様コードはexmaplesの中にある。

Compile from source

$ git clone git://github.com/apache/spark.git
$ cd spark

Export JAVA_HOME

$ export JAVA_HOME=$(/usr/libexec/java_home)
$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.7.0_72.jdk/Contents/Home

build spark

$ ./build/mvn -DskipTests clean package

10分くらいかかる模様。

[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10:25 min
[INFO] Finished at: 2015-06-25T08:34:17+09:00
[INFO] Final Memory: 72M/612M
2
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?