Code Monkey home page Code Monkey logo

raft-consensus's Introduction

Raft : Implementation in Go

CS 7610: Distributed Systems

December 3, 2018 Muhammad Ali and Meredith Accum

Building

All source code *.go files are stored in a single folder called raft. There is a makefile included for building, and for cleaning up any files that are used to save the persistent state of the Raft instances.

To build :

cd raft
go build

or

cd raft
make

Running

After building:

To run the client: From any machine that isn't one of the raft instances, run this command: ./raft -client

To run a raft instance from a fresh state:

make fresh
./raft

or

rm savedState*
./raft

To run a raft instance from a saved state: ./raft

Testing

There is an included hostfile.txt with the addresses of five linux machines 030-034.

Log in to each linux machine and start the raft program with

make clean
make 
./raft

Log in to a 6th machine and start the client ./raft -client

Interact with the client by typing commands. The client will contact nodes in the Raft cluster.

To test leader elections, kill various Raft instances with Ctrl-C and then restart them, if desired.

We've hardcoded a port into the code for testing convenience. There should be no need to change this unless multiple people are trying to test the program at the same time.

Note that a raft instance will try to load its saved state from a file, if one is found. To start from a completely fresh state, run make clean before running ./raft.

raft-consensus's People

Contributors

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