Git Product home page Git Product logo

etcd-aws-cluster's Introduction

etcd-aws-cluster

This container serves to assist in the creation of an etcd (2.x) cluster from an AWS auto scaling group. It writes a file to /etc/sysconfig/etcd-peers that contains parameters for etcd:

  • ETCD_INITIAL_CLUSTER_STATE
    • either new or existing
    • used to specify whether we are creating a new cluster or joining an existing one
  • ETCD_NAME
    • the name of the machine joining the etcd cluster
    • this is obtained by getting the instance if from amazon of the host (e.g. i-694fad83)
  • ETCD_INITIAL_CLUSTER

This file can then be loaded as an EnvironmentFile in an etcd2 drop-in to properly configure etcd2:

[Service]
EnvironmentFile=/etc/sysconfig/etcd-peers

Workflow

  • get the instance id and ip from amazon

  • fetch the autoscaling group this machine belongs to

  • obtain the ip of every member of the auto scaling group

  • for each member of the autoscaling group detect if they are running etcd and if so who they see as members of the cluster

    if no machines respond OR there are existing peers but my instance id is listed as a member of the cluster

    • assume that this is a new cluster
    • write a file using the ids/ips of the autoscaling group

    else

    • assume that we are joining an existing cluster
    • check to see if any machines are listed as being part of the cluster but are not part of the autoscaling group
      • if so remove it from the etcd cluster
    • add this machine to the current cluster
    • write a file using the ids/ips obtained from query etcd for members of the cluster

Usage

docker run -v /etc/sysconfig/:/etc/sysconfig/ monsantoco/etcd-aws-cluster

Demo

We have created a CloudFomation script that shows sample usage of this container for creating a simple etcd cluster: https://gist.github.com/tj-corrigan/3baf86051471062b2fb7

etcd-aws-cluster's People

Contributors

bkrodgers avatar ddgenome avatar leedm777 avatar su-sfeng avatar termie avatar xueshanf avatar xuwang 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.