GithubHelp home page GithubHelp logo

consul's Introduction

Autopilot Pattern Consul

Consul in Docker, designed for availability and durability.

DockerPulls DockerStars ImageLayers Join the chat at https://gitter.im/autopilotpattern/general

Prep your environment

  1. Get a Joyent account and add your SSH key.
  2. Install and the Docker Engine (including docker and docker-compose) on your laptop or other environment, along with the Joyent CloudAPI CLI tools (including the smartdc and json tools).
  3. Configure your Docker CLI and Compose for use with Joyent:
curl -O https://raw.githubusercontent.com/joyent/sdc-docker/master/tools/sdc-docker-setup.sh && chmod +x sdc-docker-setup.sh
 ./sdc-docker-setup.sh -k us-east-1.api.joyent.com <ACCOUNT> ~/.ssh/<PRIVATE_KEY_FILE>

Start a trusted Consul raft

  1. Clone or download this repo
  2. cd into the cloned or downloaded directory
  3. Execute bash start.sh to start everything up
  4. The Consul dashboard should automatically open in your browser, or follow the links output by the start.sh script

Use this in your own composition

Detailed example to come....

How it works

This demo first starts up a bootstrap node that starts the raft but expects 2 additional nodes before the raft is healthy. Once this node is up and its IP address is obtained, the rest of the nodes are started and joined to the bootstrap IP address (the value is passed in the BOOTSTRAP_HOST environment variable).

If a raft instance fails, the data is preserved among the other instances and the overall availability of the service is preserved because any single instance can authoritatively answer for all instances. Applications that depend on the Consul service should re-try failed requests until they get a response.

Any new raft instances need to be started with a bootstrap IP address, but after the initial cluster is created, the BOOTSTRAP_HOST IP address can be any host currently in the raft. This means there is no dependency on the first node after the cluster has been formed.

Triton-specific availability advantages

Some details about how Docker containers work on Triton have specific bearing on the durability and availability of this service:

  1. Docker containers are first-order objects on Triton. They run on bare metal, and their overall availability is similar or better than what you expect of a virtual machine in other environments.
  2. Docker containers on Triton preserve their IP and any data on disk when they reboot.
  3. Linked containers in Docker Compose on Triton are actually distributed across multiple unique physical nodes for maximum availability in the case of node failures.

Credit where it's due

This project builds on the fine examples set by Jeff Lindsay's (Glider Labs) Consul in Docker work. It also, obviously, wouldn't be possible without the outstanding work of the Hashicorp team that made consul.io.

consul's People

Contributors

ddunkin avatar misterbisson avatar mterron avatar rchrd avatar tgross avatar

Watchers

 avatar  avatar

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.