Giter VIP home page Giter VIP logo

etcd-cluster's Introduction

Etcd Cluster

This projects provides example code to create an embedded etcd cluster in a Golang server.

The application can than use the cluster with a central key value storage acting as a shared distributed cluster state without depending on any extra database.

Cluster

Every instance of a server, is treated as a node inside cluster. Each node have a pair of peer url and client url for internal communication between nodes. The transport.port configuration can be used to set this value of the peer port. By default it will use 2300. The client url is automatically configured by adding 1 to the peer url. Therefore when configuring multiple nodes in a cluster make sure to reserve 2 consecutive ports for each node.

Each instance of a server, require cluster.name and node.name to be set in order for the cluster to be configured accordingly and the node to join the desired cluster.

Discovery

By default, without additional configuration, a server will listen to all loopback addresses and ports 2300-2309 in order to find any node/cluster already running and join it if so.

In a use case where a 3 nodes cluster need to be boostrap from scratch, cluster.initial_master_nodes which correspond to all node.name that will be part of the cluster need to be specified.

If nodes are not port of the same network/host the discovery.seed_hosts need to be specifided in order for the cluster to listen to those IP addresses.

TODO

  • Handle Node lifecycle:
    • Join
    • Remove
  • Cluster teardown
  • Cluster Storage Interface

etcd-cluster's People

Contributors

etiennecl avatar

Stargazers

 avatar

Watchers

 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.