This is the project of Distributed Systems 2, Fall Semester 2016-17, University of Trento.
This project implements a Gossip-style Failure Detection Service. It takes inspiration from the paper "A Gossip-Style Failure Detection Service" of Robbert van Renesse (it can be found in docs folder).
Authors: Andrea Zorzi & Davide Pedranz & Davide Vecchia.
The project is organized in 4 folders:
- Failure Detector
- Cloud
- Analysis
- Report
- Results
The software is written in Java and uses the Akka framework. We use Gradle to build, test and run the project. To build and run the project, you need only a working Java 8 JDK installed on the systems. For the first build, the needed dependecies are downloaded from the Internet, so make sure to have a working Internet connection.
Run the following command from the protocol
folder:
./gradlew node
This command will generate a JAR archive build/libs/node.jar
with all the dependencies needed to run the project.
For each node instance of the system, you need to provide the following environment variables:
Variable | Scope | Notes |
---|---|---|
HOST | The hostname of the machine where Node or Client is executed. | |
PORT | The port of the Node or the Client. | |
ID | A unique ID for the new node that will join the system. | Node only. |
To run the Tracker
, run
java -jar build/libs/ds2.jar tracker
To run the Node
, run
java -jar build/libs/ds2.jar node <host> <port>
where host
and port
are respectively the ip and port of the tracker instance.
The project is provided with a node script to automate the deployment / start / stop steps.
The script can be used to automate the spawn of multiple Akka nodes in local environment or to deploy and run the project on Amazon's AWS Cloud EC2 machines.
Before use the script, it must be built using the following commands:
$ cd ./cloud
$ npm install
$ npm run build
It is possible to use the following methods to run the script (from the script folder):
node dist/index.js
npm start
These are the commands that the script provide:
Start a new experiment on AWS Cloud or in local environment (using --local
option).
Mandatory options:
- --keys Path of a json file containing AWS's secret and access key (
{"secretKey": "...", "accessKey": "..."}
) - --ssh-key Path of ssh key that can be used to access the EC2 instances
- --ssh-passphare (optional) Ssh key passphare
- --local (optional) Run the project in local
Optional experiment options:
Use node dist/index.js start --help
to list them.
$ node dist/index.js start experimentName --keys ./aws.config.json --ssh-key ./awsSsh --ssh-passphrase password
Stop and terminate all EC2 instances on AWS Cloud.
$ node dist/index.js shutdown [experimentName] --keys "./aws.config.json"
Read the log of the Tracker node.
node dist/index.js watch experimentName --keys ./aws.config.json --ssh-key ./awsSsh --ssh-passphrase password
Download experiment reports generated by the tracker and tracker log.
Options:
- --download-dir Local directory where downloaded files will be copied.
- --report-dir (optional) Remote directory where report files are located.
node dist/index.js report experimentName --keys ./aws.config.json --ssh-key ./awsSsh --ssh-passphrase password --download-dir /home/notebook/reports
The source code is licensed under the MIT license. A copy of the license is available in the LICENSE file.