Creates a Vagrant Virtualbox VM that installs Apache Mesos and Marathon
- Source code - Github
- Author - Gavin Noronha - gavinln@hotmail.com
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.
-
To start the virtual machine(VM) type
vagrant up
-
Connect to the VM
vagrant ssh
-
If you see the "Z Shell configuration function for new users" enter 2
-
Check whether ZooKeeper is running
sudo status zookeeper
-
Connect to ZooKeeper (If successful you will see the word CONNECTED
sudo /usr/share/zookeeper/bin/zkCli.sh -server localhost:2181
-
Type
quit
to exit the zkCli application
-
Change to the scripts directory
cd /vagrant/scripts
-
Start tmux
./tmux_start.sh
-
Start mesos-master
sudo ./master_mesos_start.sh
-
Switch to the other pane. Type Ctrl+b, o
-
Start mesos-slave
sudo ./slave_mesos_start.sh
-
Detach from the Tmux session. Type Ctrl+b, d
-
To attach to the running session again
tmux attach-session -t mesos
-
Type Ctrl+c and exit to stop the mesos master and slave
-
Access the Mesos master in the browser.
-
Access the Mesos slave in the browser.
-
If you see a blank page without errors the slave is correctly started
-
sudo start marathon
-
sudo status marathon
-
Access Marathon in the browser at the URL.
-
Go to the Marathon dashboard
-
Create a new app by clicking on the "New App" button
-
Enter the ID as flask-env
-
Enter the command all on one line (blank lines may cause problems)
/usr/bin/python /vagrant/python/flask_env/run.py
-
Click "Create"
-
Access the Flask application by changing the port at
http://192.168.33.10:PORT
-
Go to the Marathon dashboard
-
Create a new app by clicking on the "New App" button
-
Enter the ID as ipython
-
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
-
Click "Create"
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.