Git Product home page Git Product logo

sparrowdo-spark's Introduction

Synopsis

Instal Spark cluster with Docker and Sparrowdo and CentOS.

Caveat

CentOS is a only supported platform for the moment. Tested against official CentOS Docker image.

Install

$ zef install Sparrowdo Sparrowo::RemoteFile Sparrowdo:Archive
$ git clone https://github.com/melezhik/sparrowdo-spark.git
$ cd sparrowdo-spark # all the following commands will be run from here

Usage

Setup docker

First of all you should create a dedicated network for all Spark instances:

$ docker network create --subnet=172.18.0.0/16 spark-net

Install master

Run Docker container for master. You should call Spark master container as master, it is obligatory:

$ docker run --entrypoint init --net spark-net --ip 172.18.0.2 -t -d --name master centos

Deploy Spark master on running container:

$ sparrowdo \
--docker=master \
--no_sudo \
--sparrowfile=sparrowfile-master \
--format=production --bootstrap

Install slaves

Run Docker container for slave:

$ docker run --privileged --entrypoint  init  -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
  --net spark-net --ip 172.18.0.4 -t -d --name worker1 centos

Deploy Spark slave on running container:

$ sparrowdo \
--docker=worker1 \
--no_sudo \
--sparrowfile=sparrowfile-slave \
--format=production --bootstrap

And so on, launch as many slaves as you wish.

Picking up new slaves

Once you've created a master and some slaves, you need to run cluster launch script so that master found its new slaves.

$ nano config.pl6

{
  master => '172.18.0.2',
  workers => (
    '172.18.0.4',
    '172.18.0.5',
    '172.18.0.6'
  )
}


$ sparrowdo \
--docker=master \
--no_sudo \
--sparrowfile=sparrowfile-cluster-launch \
--format=production --bootstrap

Wait for awhile, let Spark do its job and then visit Spark web UI to check that both master and slaves get run successfully:

$ firefox 172.18.0.2:8080

See also

https://spark.apache.org/docs/latest/spark-standalone.html

sparrowdo-spark's People

Contributors

melezhik avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.