Home

Awesome

ansible-mesos-playbook

An ansible playbook for launching a mesos cluster with native docker and mesos executors, along with Marathon), Consul and HAProxy support. Run this on Ubuntu 14.04 LTS (preferred) or Centos/RHEL 6. Read the blog post for a descriptive overview.

Getting Started

The Setup

Altering the Playbook

There are a variety of tweaks you can make to this playbook for your needs.

Troubelshooting

If you have trouble, /var/log/syslog on Ubuntu and /var/log/messages on RHEL is your friend. For Zookeeper, try /var/log/zookeeper/zookeeper.log. You can try re-running the playbook; the roles aren't perfect but most are idempotent.

Ansible lets you perform actions on groups of servers. You can try query or restart zookeeper and/or mesos:

$ ansible mesos_primaries -a "sudo status zookeeper"
$ ansible mesos_primaries -a "sudo restart zookeeper"

Notes

Currently this installs Mesos 0.20.1 with Marathon 0.7.3.

Launching a Container

POST to /v2/apps:

{
    "id": "mlh", 
    "container": {
        "docker": {
            "image": "mhamrah/mesos-sample",
            "network": "BRIDGE",
            "portMappings": [
                { "containerPort": 8080, "hostPort": 0, "protocol": "tcp" }
            ]
        },
        "type": "DOCKER"
    },
    "cpus": 0.5,
    "mem": 512,
    "instances": 1
}