Deploying your microservice to Mesos using Marathon
Now that we have a fully functional Mesos cluster with the Marathon framework, we are ready to spin off new tasks (or Docker containers) on Marathon. In this recipe, we will deploy our Dockerized geolocation microservice on Marathon.
Getting ready
Before you start, make sure your Mesos cluster is up and running. You can do this by executing the docker ps -a
command. You should see four containers running: Mesos master, Mesos slave, Marathon, and Zookeeper:
Sometimes, it is possible that either the Mesos master or slave, or even the Marathon container, might go down. This usually happens when it runs out of resources or probably when you restart your computer and they try to come back up, but they might not be able to orchestrate properly. In those cases, make sure you stop the whole cluster and perform a clean start. You can do that by running the following command:
docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q) ...