Skip to content

gavinln/mesos-marathon

Repository files navigation

mesos-marathon

Creates a Vagrant Virtualbox VM that installs Apache Mesos and Marathon

About


This project provides a Ubuntu (14.04) Vagrant Virtual Machine (VM) with Apache Mesos and Marathon setup. It demonstrates running a Python Flask and IPython notebook application. In addition Zookeeper is setup to manage the cluster.

There are Puppet scripts that automatically install the software when the VM is started.

Starting the virtual machine

  1. To start the virtual machine(VM) type

    vagrant up
    
  2. Connect to the VM

    vagrant ssh
    
  3. If you see the "Z Shell configuration function for new users" enter 2

Starting servers

Starting ZooKeeper

  1. Check whether ZooKeeper is running

    sudo status zookeeper
    
  2. Connect to ZooKeeper (If successful you will see the word CONNECTED

    sudo /usr/share/zookeeper/bin/zkCli.sh -server localhost:2181
  3. Type quit to exit the zkCli application

Starting Mesos

  1. Change to the scripts directory

    cd /vagrant/scripts
  2. Start tmux

    ./tmux_start.sh
  3. Start mesos-master

    sudo ./master_mesos_start.sh
    
  4. Switch to the other pane. Type Ctrl+b, o

  5. Start mesos-slave

    sudo ./slave_mesos_start.sh
    
  6. Detach from the Tmux session. Type Ctrl+b, d

  7. To attach to the running session again

    tmux attach-session -t mesos
  8. Type Ctrl+c and exit to stop the mesos master and slave

Check Mesos servers

  1. Access the Mesos master in the browser.

  2. Access the Mesos slave in the browser.

  3. If you see a blank page without errors the slave is correctly started

Start Marathon

  1. sudo start marathon

  2. sudo status marathon

  3. Access Marathon in the browser at the URL.

Setup the Python Flask application

  1. Go to the Marathon dashboard

  2. Create a new app by clicking on the "New App" button

  3. Enter the ID as flask-env

  4. Enter the command all on one line (blank lines may cause problems)

    /usr/bin/python /vagrant/python/flask_env/run.py
    
  5. Click "Create"

  6. Access the Flask application by changing the port at http://192.168.33.10:PORT

Setup the IPython application

  1. Go to the Marathon dashboard

  2. Create a new app by clicking on the "New App" button

  3. Enter the ID as ipython

  4. Enter the command all on one line (blank lines may cause problems)

    /usr/local/bin/ipython notebook --no-browser --ip=0.0.0.0 --port=$PORT
    
  5. Click "Create"

Requirements

The following software is needed to get the software from github and run Vagrant to set up the Python development environment. The Git environment also provides an SSH client for Windows.

About

A Vagrant Ubuntu VM that has a single node master-slave Apache Mesos cluster with the Marathon framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published