Skip to content

Ekirapapaul/Bully-Algorithm-Java-RMI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bully Algorithm : Java RMI

This is an implementation of Bully Algoritm using Java RMI. The implementation assumes a node to be a server implementation in Java RMI.

Steps to Run

1 Move to your project directory

$ cd [path to your directory]

2 Compile the source files. Replace destDir with your directory path

$ javac -d destDir BullyInterface.java Node1.java Node2.java Node3.java Node4.java

3 If no error message, Start the rmi registry

$ start rmiregistry

4 Start the nodes. Replace destDir with the path of your Directory

start java -classpath destDir -Djava.rmi.server.codebase=file:classDir/ bully.algorithm.Node1
start java -classpath destDir -Djava.rmi.server.codebase=file:classDir/ bully.algorithm.Node2
start java -classpath destDir -Djava.rmi.server.codebase=file:classDir/ bully.algorithm.Node3
start java -classpath destDir -Djava.rmi.server.codebase=file:classDir/ bully.algorithm.Node4

Managing Nodes

When a node is initiated it gives some output as well as start a fresh election.

Terminate a node

When on the node terminal window press ctrl + C to terminate a node.

Note : Dont close the terminal window of a node by pressing the close button. This will generate errors

Further Reading

About

An implementation of the Bully Algorithm using Java RMI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages