Giter Site home page Giter Site logo

consul-coreos's Introduction

Consul + CoreOS - hassles

This is for running a Consul cluster on CoreOS using etcd to bootstrap it.

Why?

While CoreOS already has etcd built in and it is very similar to Consul, it is missing some of the service discovery features offered by Consul. Namely the service catalog and service health checking. These things are nice to have.

This also allows you to run Registrator on CoreOS clusters and still get the Consul-backed extra features (such as health-check support).

Usage

  1. Clone this repo: git clone https://github.com/cap10morgan/consul-coreos.git.
  2. Check if the file /etc/environment exists on your CoreOS machine(s).
    1. On AWS and probably some other cloud environments it gets created automatically. But it will not exist if you're running CoreOS on bare metal, for example.
    2. If it doesn't exist, create it like this: echo 'COREOS_PRIVATE_IPV4=your.ip.address' > /etc/environment
  3. Submit and run the included service file on your CoreOS cluster:
fleetctl submit [email protected]
fleetctl start consul@1
fleetctl start consul@2
... as many more as you want

Fleet will run one Consul container per CoreOS node, so you probably want to start a consul@N up to the number of CoreOS nodes in your cluster. Although be aware that currently this runs all of them as Consul servers, which is not recommended past a ceratin cluster size (some of them should start being run as clients past a certain number of nodes). Pull requests welcome!

Implementation

It uses etcd to coordinate the bootstrapping of a Consul cluster on CoreOS. It runs Consul inside Docker containers (as nature intended) using progrium's excellent Consul Docker image.

TODO

  1. Switch to adding client nodes (as opposed to more server nodes) when the cluster is above a certain size. For now this has been tested on a 3-node cluster and should work on clusters close to that size.

License

BSD

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.