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.
gem install librarian-ansible
librarian-ansible install
cp hosts.sample hosts
and update the mesos_masters
and mesos_slaves
groups.cp ansible.cfg.sample ansible.cfg
to ensure librarian_roles is in the ansible path (ansible.cfg
is git-ignored).ansible-playbook playbook.yml
.There are a variety of tweaks you can make to this playbook for your needs.
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"
Currently this installs Mesos 0.20.1 with Marathon 0.7.3.
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
}