Giter Site home page Giter Site logo

electionalgorithm's Introduction

Bully Election Algorithm for Distributed Cluster Nodes

################### Introduction ###################

A bully election algorithm is implemented using a Java Program. The algorithm can run on Nodes of the Ukko Cluster as well as Local System. The bully election algorithm is used to dynamically electing a coordinator by ID number. The node with the highest ID number is selected as the coordinator. The Nodes other than coordinator keep on pinging to the coordinator to check the state of coordinator. If any Node discovers, the current coordinator is down because of message timeouts, it performs the election in a system to find out new coordinator in a system. The Node who discovers, the current coordinator is in down state, the Node broadcasts an election message (inquiry) to all other Nodes. If the Node hears from highest Index ID Node, the Node will drop an Election and the Other Node with highest index ID will continue the Election process in a System. If the Node does not hear from any other higher ID Node, it will win the Election and declare itself as a new Coordinator for the System. The process of Election continues till the Highest ID Node declares itself as new Coordinator for the System.

App.java - Entry Point for Java Application

Java API : { project directory }\doc\index.html

Class Diagram : { project directory }\ classDiagram\Model.png

[Tested on Localhost and Ukko Cluster]

################### Assumption ###############################

  • Message delivery between processes should be reliable
  • Prior information about other Node id's must be known
  • All the IP address mention in the configuration_file are unique.
  • Election initiated by only single node. When the Node send message to other nodes, Other Node who receive message whose id is greater than current Node, will bully the existing Election and start a fresh Election. In a system, only single election is going on at any moment.
  • Server Node is an alias used for Coordinator of the System. Coordinator is a current Leader for the System consists of number of nodes.
  • The system used predefined set of nodes, and other nodes in a system are known.

################### Project Structure ###################

BullyElectionAlgorithm/

  • src
  • configuration_file.txt ----- {Java Source Code}
  • classDiagram ----- {Class Diagram of the Code}
  • doc ----- {Java API Documentation}
  • readme.txt
  • sources.txt

################### Compile and Running the App Notes ###################

App.java file is entry point for the App. Run the program using App.java file. Before running the source code, compile all java files into bytecode.

Step 1>> Go to Project source folder, and perform following commands to compile the source code.

For Linux ::

$ find -name "*.java" > sources.txt

$ javac @sources.txt

{ sources .txt will contain a list of all the files in a project folder }

Step 2>> Run the Application Code::

$ java App configuration_file.txt

The App.java is the entry point for the Application. The Structure of the Command should be ::

Note :: the configuration file should be under src folder of the Project Source code

################### Configuration Notes ###################

This App implements Bully Election Algorithm.

App.java file is entry point for the App. Run the program using App.java file. Before running the source code, compile all java files into bytecode.

Configure Nodes for the App in a configuration_file.txt file. Add the nodes as ::

eg: 12345 192.168.123.234 4457

################### ADVANCE DEBUGGING ###################

Logger.java help to perform advance Debugging and see the calls proceeding between system.

Enable the DEBUG flag to perform advance debugging of the App

public static final boolean DEBUG = true;

electionalgorithm's People

Contributors

msimar avatar

Stargazers

BarryLee avatar Sevinj Jafarli avatar  avatar Necati Kartal avatar

Watchers

James Cloos avatar  avatar  avatar

electionalgorithm's Issues

error in configuration file

Please help me remove the error.
It is showing an error in the config file. How do I input the values in the config file. Please provide an example.

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.