Code Monkey home page Code Monkey logo

dockstack's Introduction

#DockStack

DockStack is a Docker ambassador based on SmartStack http://nerds.airbnb.com/smartstack-service-discovery-cloud/. It uses zookeeper or etcd (WIP) as discovery service.

DockStack is composed of two tools:

Both tools use a YAML config file, which is not ideal to use with Docker. A wrapper script heavily simplifies the generation of this files via CLI.

##Setup ####Zookeeper You can easily setup Zookeeper on your hosts using https://registry.hub.docker.com/u/thefactory/zookeeper-exhibitor/

####MySQL Any other service will work

  • Spawn a MySQL container
host1 $ docker run -d --name mysql -p :3306 -e MYSQL_ROOT_PASSWORD=test mysql
  • Create an healt-check user
host1 $ docker exec -ti mysql mysql -u root -p -e 'CREATE USER 'haproxy_check'@'%'; FLUSH PRIVILEGES;'

####Nerve

host1 $ docker run \
	-ti --rm \ # -d
	-v /usr/bin/docker:/usr/bin/docker:ro \
	-v /lib64/libdevmapper.so.1.02:/lib/libdevmapper.so.1.02:ro \
	-v /var/run/docker.sock:/var/run/docker.sock \
	-e SERVICE_HOST=176.31.235.180 \
	asiragusa/nerve \
	-d zk://<zookeeper_hosts comma separated>/nerve \
	-s mysql:tcp:mysql:3306:/test

####Synapse

host2 $ docker run \
	-ti --rm \ # -d
	--name synapse
	asiragusa/synapse
	-d zk://<zookeeper_hosts comma separated>/nerve \
	-s mysql:mysql:/test

####Testing Here the magic happens! (Running a mysql image, as it carries by default mysql-client)

host2 $ docker run -ti --rm --link synapse:db mysql:latest mysql -u root -h db -p

The connection is transparently proxified by HAProxy

##TODO Create more service config files and examples ready to use

##Authors

##Special thanks To Jérôme Petazzoni for the great idea!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.