# Auto-healer using Zookeeper
In cloud computing, auto-healing is a feature used to monitor a cluster and detect faulty application instances.

If a faulty instance is detected, the node is shut down and a new node is created with a healthy application instance.

In this practical assignment we will implement a very basic auto healer which will monitor a group of worker instances.



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.


### Build the Autohealer as a jar

### Run the autohealer, which in turn would launch and maintain 10 workers
```
java -jar target/autohealer-1.0-SNAPSHOT-jar-with-dependencies.jar <number of workers> <path to woker jar>
```

#### Example:
```
java -jar target/autohealer-1.0-SNAPSHOT-jar-with-dependencies.jar 10 "../transientworker/target/transientworker-1.0-SNAPSHOT-jar-with-dependencies.jar"
```
