linusyang / sparkdemo

Simple Demo for Running Apps on Apache Spark

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spark Live Demo

Copyright (c) 2014 Linus Yang & Tomas Tauber

Introduction

Usage

  1. Install the latest Spark releases on your node. And if you need to build the Scala code, you need to install sbt.
  2. Setup your Spark cluster by this tutorial (Standalone mode is recommended).
  3. Clone this repository on every node of your Spark cluster at the same location by running git clone https://github.com/linusyang/sparkdemo.git && cd sparkdemo/.
  4. Setup the configuration by editing the Makefile (you should have the make utility first):
    • SPARK_HOME: Directory where Spark is installed
    • SPARK_MASTER: URL (spark://) of Spark master node
    • SPARK_MEMORY: Memory size used for every Spark worker node
  5. Startup the Spark service by running make up.
  6. Run the demo by either interactively in a shell by make or in a batch by make run:
    • make: If you run in the shell, type new Worker().run(sc) or type new Worker().read(sc).pair().calc().show() to get the result.
    • make run: Or if you run in a batch, you will directly get the result.
  7. If you want to stop the Spark cluster when finished the demo, use make down to shutdown all Spark instances.

License

Licensed under GPLv3.

About

Simple Demo for Running Apps on Apache Spark


Languages

Language:CSS 49.8%Language:Scala 41.1%Language:JavaScript 9.1%