Giter VIP home page Giter VIP logo

bully-algorithm's Introduction

Bully Algorithm Visualization

intro logo

codecov CircleCI Go Report GoDoc License

Table of Contents

What this repository is about

This repository contains source code of an implementation of the bully algorithm written in Go and a small browser visualization tool.

This has been made for learning purposes about distributed algorithms, Bully algorithm being the simplest leader election algorithm to implement.

Finally, I feel like implementing an algorithm myself helps me to understands it better and I thought it could be interesting to someone else.

What is the Bully algorithm ?

The Bully algorithm is one of the simplest algorithm made to design a coordinator among a set of machines.

Quickstart

First, go get this repository:

go get -d github.com/timtosi/bully-algorithm

Quickstart with Docker

โ— If you don't have Docker and Docker Compose installed, you still can execute this program by compiling the binaries.

This program comes with an already configured Docker Compose file launching five nodes and the browser based user interface.

You can use the run target in the provided Makefile to use it easily:

asciicast

You can access the visualization through your browser at localhost:8080. If you want to test the cluster behaviour, you can stop and resume some of the nodes with docker commands.

๐Ÿ’ก If you want to update the number of node or change some IDs you will have to update the configuration file and the Docker Compose file accordingly.

Quickstart without Docker

First compiles and launch the visualization server:

cd $GOPATH/src/github.com/timtosi/bully-algorithm/cmd/data-viz
go build && ./data-viz

Visu

Then launch at least two nodes with specifying their ID in argument:

cd $GOPATH/src/github.com/timtosi/bully-algorithm/cmd/bully
go build && ./bully 0

๐Ÿ’ก IDs should by default be comprised between 0 to 4 but you should be able to update peer address default configuration easily.

Nodes

You can access the visualization through your browser at localhost:8080.

FAQ

None so far ๐Ÿ™Œ

License

Every file provided here is available under the MIT License.

Not Good Enough ?

If you encouter any issue by using what is provided here, please let me know ! Help me to improve by sending your thoughts to [email protected] !

bully-algorithm's People

Contributors

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