yetu / ansible-smartstack

Service discovery with airbnb smartstack and serf
MIT License
7 stars 2 forks source link

ansible-smartstack

Build Status

SmartStack is an automated service discovery and registration framework. This ansible role installs airbnb smartstack, which includes following components

For more information on smartstack This role uses the getyourguide smartstack fork.
The role will use serf instead of zookeeper.

How it Works

That means, Serf is required both for nerve and synapse and Haproxy is required only for synapse.

Requirements

This role is tested with ubuntu 12.04 and ansible 1.7

Role Variables

Please check following files for variables

default/main.yml
vars/services.yml

Usage

Installation of synapse and nerve are have to be explicitly stated in your playbook.

    nerve_install           : True

If you would like to install synapse

    synapse_install         : True

You also have to give the list of services that you want to make available, for instance if you would like to announce the postgres service

    nerve_selected_services       : [ "postgresql" ]

You also have to give the list of services that you want to connect to / use, for instance if you would like to connect to a memcache service running on another server:

    synapse_selected_services       : [ "memcache" ]

You also need to define the services that you need, an example how services can be defined can be found at

vars/services.yml

Once you define your services you can give the path of your service file as a variable to the this role:

    smartstack_services_files  : "my-services.yml"

Example Playbook

Head to demo directoy Requires Vagrant 1.5 +

vagrant up Two vagrant images will be created

demo1 (192.168.56.150)

demo2 (192.168.56.151)

To check serf members

From demo1 or demo2 type serf members

To check haproxy stats page

http://192.168.56.151:3212/

Simulate failure serf failure

On demo1 type sudo service serf stop then on demo2 serf members

Enable back serf on demo1 by typing sudo service serf stop

Simulate postgresql faliure

on demo2 sudo service postgresql stop then head to http://192.168.56.151:3212/

License

MIT

TODOs

Contributors (sorted alphabetically on the first name)