Modify the environment variable ZK_HOME
and BYTEMAN_HOME
in the setup.sh
script.
Don't forget to compile the ZooKeeper in ZK_HOME
.
$ ./setup.sh
The setup.sh
script creates the environment and other scripts in this directory.
$ ./start_zookeeper_cluster.sh
Start the ZooKeeper cluster of 3 nodes, with all data in this directory.
$ ./client.sh 1
Start the client connected to server 1, which is assumed to be a follower. You can connect to server 2 or 3 similarly.
Then you can try to make some requests in the client REPL. Everything should work well now.
$ ./start_injection.sh 1
Inject the fault in server 1. Similarly you can inject in server 2 or 3.
After the injection, each invocation specified in writePacket-delay.btm
will be injected a 30s delay. You can modify this duration in the btm file.
You can continue to use the client in Step 4 or start a new client according to the instruction in Step 4.
Since you've inject the fault in server 1 (or another server), you should be able to see that in the faulty server, the client gets stuck.
You can also see something in the log of the leader node (in ./logs-2
, if server 2 is the leader).
$ ./stop_injection.sh 1
Stop the fault injection in server 1. Similarly you can do in in server 2 or 3.
After 30s (or other duration you specify in the btm file), you should be able to see that the client is not stuck and everything works well.
$ ./stop_zookeeper_cluster.sh
Stop the ZooKeeper cluster for this experiment.