This repo contains everything you need to set up a complete Mesos cluster with the following components -
- zookeeper
- mesos (masters + slaves)
- marathon
- chronos
- docker (on the slaves)
- haproxy + roger-bamboo (for load-balancing/proxy)
It also contains examples to show how to set up single as well as multi-node clusters using Vagrant VMs (see vagrant/).
- Ansible is installed on the control machine (prior knowledge of ansible helps.)
- Inventory (aka a set of host machines) exists and have ubuntu 14.0.4 LTS along with openssh-server installed.
- Sudo access to each of the host machines is available.
- Ensure that an inventory file exists with the list of masters, slaves, etc. (see an existing hosts file in the hosts dir under vagrant.)
- Run the following commands (WARNING: the first command below will reboot the hosts):
$ ansible-playbook -i <path-to-hosts-file> --user=<user> --ask-pass --ask-sudo-pass --extra-vars="restart_machine=true" base.yml
$ ansible-playbook -i <path-to-hosts-file> --user=<user> --ask-pass --ask-sudo-pass zookeeper-nodes.yml
$ ansible-playbook -i <path-to-hosts-file> --user=<user> --ask-pass --ask-sudo-pass --extra-vars="mesos_cluster_name=<cluster-name-to-use>" master-nodes.yml
$ ansible-playbook -i <path-to-hosts-file> --user=<user> --ask-pass --ask-sudo-pass marathon-nodes.yml
$ ansible-playbook -i <path-to-hosts-file> --user=<user> --ask-pass --ask-sudo-pass chronos.yml
$ ansible-playbook -i <path-to-hosts-file> --user=<user> --ask-pass --ask-sudo-pass slave-nodes.yml
$ ansible-playbook -i <path-to-hosts-file> --user=<user> --ask-pass --ask-sudo-pass bamboo-nodes.yml
- Make sure host file contains docker_registry group.
- Run:
$ ansible-playbook -i <path-to-hosts-file> --user=<user> --ask-pass --ask-sudo-pass docker-registry.yml
- The
--ask-pass
and--ask-sudo-pass
are not needed if ssh key is added and the user is part of the sudo group in the host machines. - To restart a service on all hosts, you can use ansible's service module. For example:
$ ansible zookeeper -i <path/to/hosts/file> --user=<user> --ask-pass --ask-sudo-pass -m service -a "name=zookeeper state=restarted" -s
$ ansible marathon_servers -i <path/to/hosts/file> --user=<user> --ask-pass --ask-sudo-pass -m service -a "name=marathon state=restarted" -s