Commit 06400868 authored by drnull03's avatar drnull03

restructed the project

parent 26a0fb48
...@@ -32,7 +32,7 @@ public class Worker { ...@@ -32,7 +32,7 @@ public class Worker {
while (true) { while (true) {
logger.debug("Working..."); logger.debug("Working...");
LockSupport.parkNanos(100_000_000); // 0.1s LockSupport.parkNanos(100_000_000); // 0.1seconds
if (random.nextFloat() < CHANCE_TO_FAIL) { if (random.nextFloat() < CHANCE_TO_FAIL) {
logger.error("Application-level failure occurred"); logger.error("Application-level failure occurred");
throw new RuntimeException("Simulated worker crash"); throw new RuntimeException("Simulated worker crash");
......
...@@ -7,16 +7,37 @@ In this practical assignment we will implement a very basic auto healer which wi ...@@ -7,16 +7,37 @@ In this practical assignment we will implement a very basic auto healer which wi
You are given a worker application
The worker instances are running a very complex computation that tends to crash in a particular edge case that the author did not account for.
Our mission is to maintain at least N worker nodes at any given moment.
If a worker crashes, we need to start a new worker. ### How the homework is divided
Homework/part1 implements quesiton one of the autohealer
Homework/part2 implements question two of the autohealer
### setting up the zookeeper
the script launch.sh in part1 and part2 launch the zookeeper with the correct configuration
### finding the conf for the zookeeper for each part
Part1: standalone.cfg is the file that contains the zookeeper standalone configuration]
Part2: conf folder contains zoo1.cfg ,zoo2.cfg and zoo3.cfg for building an ensemble of 3 nodes
### Build the Autohealer as a jar ### Build the Autohealer as a jar
### Note part1 and part2 are compiled and run in the same way
frist
mvn clean
mvn compile
mvn package
in part1 autohealer and worker
and in part2 accordingly
### Run the autohealer, which in turn would launch and maintain 10 workers ### Run the autohealer, which in turn would launch and maintain 10 workers
``` ```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment