LoginSignup
2
2

More than 5 years have passed since last update.

brewでSparkをインストールする

Posted at

ちょっと試したい時にローカル環境にSpark入れたのでメモ。

# brew でインストール
brew update
brew install apache-spark

# パスを通す
export SPARK_HOME="/usr/local/Cellar/apache-spark/1.6.2/libexec/"
export PYSPARK_SUBMIT_ARGS="--master local[2]"

これだけ。
次回も使うんだったら.bashrcに書いておく。

echo 'export SPARK_HOME="/usr/local/Cellar/apache-spark/1.6.2/libexec/"' >> ~/.bashrc
echo 'export PYSPARK_SUBMIT_ARGS="--master local[2]"' >> ~/.bashrc

たぶんbrewのSparkのバージョン変わったらパスを通す場所が変わるので、brew infoで確認するとよいらしい。

:~ $ brew info apache-spark
apache-spark: stable 1.6.2, HEAD
Engine for large-scale data processing
https://spark.apache.org/
/usr/local/Cellar/apache-spark/1.6.2 (842 files, 300.2M) *
  Built from source on 2016-07-20 at 15:21:29
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/apache-spark.rb

少し重いけど、ちょっと試したいだけなら十分だった。
MLlibもちゃんと動いたし。

参考URL

2
2
0

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
2