Code Monkey home page Code Monkey logo

duckduckgoose's Introduction

duckduckgoose

A system that selects a single node as a “Goose” within a cluster of nodes. Every other node should be considered a “Duck”.

Usage

# Build the binary
go build

# Spin up some nodes locally (recommend either 3 or 5)
./duckduckgoose -state_dir /tmp/0 -raft_addr=:8080 -api_addr=:9090 -bootstrap_cluster
./duckduckgoose -state_dir /tmp/1 -raft_addr=:8081 -api_addr=:9091 -join=localhost:8080
./duckduckgoose -state_dir /tmp/2 -raft_addr=:8082 -api_addr=:9092 -join=localhost:8080

# Fetch roles from running nodes (duck or goose)
curl http://localhost:9090/v1/get-role
curl http://localhost:9091/v1/get-role
curl http://localhost:9092/v1/get-role

# list information about cluster
curl http://localhost:9090/v1/nodes

# remove node from cluster
curl -X DELETE http://localhost:9090/v1/nodes/[NODE_ID]

How it works

This program leverages github.com/shaj13/raft to implement a consensus algorithm. We treat the leader as "Goose", and all other nodes as "Duck".

duckduckgoose's People

Contributors

tbarker25 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.