Developed by: Ritesh Ghorse, Shreyas Muralidhara, Tanvi Pandit
-
This project is an implementation of 4 Gossip protocols for failure detection in distributed system: Random Gossip, Round Robin Gossip, Binary Round Robin Gossip, Sequence Check Round Robin.
-
Implementation is in Python3.
-
XMLRPC is used for communication.
-
Each docker container serve as a different node.
- XMLRPC setup: Ritesh Ghorse
- 3- way handshake - Shreyas Muralidhara
- Random Gossip - Tanvi Pandit
- Binary Round Robin - Ritesh Ghorse
- Round Robin and Sequence Check Round Robin: Shreyas Muralidhara
- Monitoring Node: Ritesh Ghorse
- Provider Node: Shreyas Muralidhara
- Docker Containers: Tanvi Pandit
- Flask app: Tanvi Pandit
- Test Cases: Each of ous tested our implemented protocols. Sequence Check was divided evenly for test cases.
docker exec -u root -it monitor-node /bin/bash
python Monitoring_Node.py --config config_files/monitor.json
docker exec -it provider-node /bin/bash
python Provider_Node.py --config config_files/provider.json --version random
docker exec -u root -it node1 /bin/bash
python gossip_server.py --config config_files/config1.json
docker exec -u root -it node2 /bin/bash
python gossip_server.py --config config_files/config2.json
docker exec -u root -it gossiprpc_node_3 /bin/bash
python gossip_server.py
docker exec -u root -it gossiprpc_node_4 /bin/bash
python gossip_server.py
docker exec -u root -it gossiprpc_node_5 /bin/bash
python gossip_server.py
docker exec -u root -it gossiprpc_node_6 /bin/bash
python gossip_server.py
docker exec -u root -it gossiprpc_node_7 /bin/bash
python gossip_server.py
docker exec -u root -it gossiprpc_node_8 /bin/bash
python gossip_server.py
- Terminate one node by hitting "Ctrl+C" on one of the running node.
- Immideately enter 1 on the Monitoring Node terminal.
- It will write out the results in "results.txt" file once it reaches consensus.
- Terminate two nodes simultaneously by hitting "Ctrl+C" on two of the running nodes.
- Immideately enter 2 on the Monitoring Node terminal.
- It will write out the results in "results.txt" file once it reaches consensus.
- Start the previously terminated node again.
- Immideately enter 3 on the Monitoring Node terminal.
- It will write out the results in "results.txt" file once it reaches consensus.
-
docker build -t gossip <path-to-Dockerfile>
-
- When doing it for the first time
docker-compose up -d --build --scale node=<no of containers to spin apart from seed nodes>
- For subsequent runs when the image is the same
docker-compose up -d --scale node=<no of containers to spin apart from seed nodes>
-
sudo docker exec -it <container-name> /bin/bash
-
- Make sure you create an image for the code beforehand
docker build -t gossip <path-to-Dockerfile>
- Run the container
docker run -it --name <container-name-optional> --network gossip_network gossip
-
- docker build -t gossip . -> builds docker image
- docker network create --driver bridge gossip-network -> creates network
-
- docker run -it --name monitor-node --network gossip-network gossip -> run the docker image
- Inside the terminal
app_user@bd390faf66db:~$ python Monitoring_Node.py --config ./config/monitor.json
-> this is like a new terminal use it as monitor-node
-
Provider Node
- docker run -it --name provider-node --network gossip-network gossip -> run the docker image Inside the terminal
app_user@bd390faf66db:~$ python Provider_Node.py --config ./config/provider.json
-> this is like a new terminal use it as provider-node
-
New terminal for node 1
- docker run -it --name node1 --network gossip-network gossip
- Inside the terminal
app_user@bd390faf66db: python gossip_server.py --config ./config/config1.json
-
New terminal for node 2
- docker run -it --name node2 --network gossip-network gossip
- Inside the terminal
app_user@bd390faf66db: python gossip_server.py --config ./config/config1.json
-
Normal node
- docker run -it --network gossip-network gossip
- Inside the terminal app_user@bd390faf66db: python gossip_server.py
-
- docker rm $(docker ps --filter name=node* -aq) --> kill the docker dameon running earlier
docker-compose down
docker stop $(docker ps --filter status=running -q)