Product, Use Cases

Build a simple distributed, fault-tolerant framework on top of Apache Mesos

Aug 01, 2013

Tobi Knaup


The example framework can launch a given number of instances of a command across a cluster and will restart the command if it fails.




Install Autotools and Libtool


Mesos uses autotools to build. Install via Homebrew on a Mac:


brew install autoconf automake libtool


Install Mesos


The Mesos repo on Github is currently out of sync. You can use the one below for now.


git clone mesos./bootstrapmkdir buildcd build../configuremakemake install


**Please note:, **when installing mesos on OS 10.8, in order to compile it, you need to first ensure you have JDK 1.7 installed. You can download the Oracle JDK here: Once you have installed JDK 1.7, you need to run "export JAVA_HOME=`/usr/libexec/java_home -v 1.7`". Then you can build mesos. Due to some issues with the JDK & OS X, a pop-up might appear upon launching mesos that will ask you to now install JDK 1.6 which is required to run mesos.


Run Zookeeper and Mesos


Mesos ships with Zookeeper. Run these commands in different terminal windows to start a local Zookeeper, Mesos master, and Mesos slave.


cd /path/to/incubator-mesos/build/third_party/zookeeper-3.3.4cp conf/zoo_sample.cfg conf/zoo.cfg./bin/ start


/usr/local/sbin/mesos-master --zk=zk://localhost:2181/mesos


/usr/local/sbin/mesos-slave --master=zk://localhost:2181/mesos


Add the Mesos JAR to your local Maven Repo


mvn install:install-file -Dfile=/path/to/incubator-mesos/build/src/mesos-0.13.0.jar -DgroupId=org.apache.mesos -DartifactId=mesos -Dversion=0.13.0 -Dpackaging=jar




The Git repo for this tutorial is available at There are tags called step0 - step5 to help you navigate.

Ready to get started?