A collection of unix style tools in GO to do chaos engineering or testing.
Coming soon, tool to simulate slowness
Run the script in the following order to setup a master-slave MySQL cluster via docker:
cd mysql
- Goes in to themysql
folder first../start.sh
- Builds and starts 2 MySQL Docker containers. One master, one slave.docker logs -f mysql-master
- And wait for master MySQL instance to finish initialization../setup.sh
- Sets up the master-slave relation, adds data, and do a basic query test../failover.sh
- To start the interactivemysqlfailover
monitor and auto-failover process.
The scripts are the same as the basic MySQL setup. Except that there is no failover step as all instances are considered master.
cd etcd
- Go to etcd folder../build.sh
- Builds required Docker images../start.sh
- Starts the main ETCD instance../seed.sh
- Seed initial data to ETCD. Run again if you encounter a timeout error.
Use ./ctl.sh
script when you need to run etcdctl
. Example:
$ ./ctl.sh get /chaostesting/datasources
[ { "name": ...
- Install via Homebrew
brew install etcd
- Gets etcdctl via go get
go get github.com/coreos/etcd/client
- Uses
seed-local.sh
instead ofseed.sh
cd app
- Go to the app folder../build.sh
- Build app's Docker image../start.sh
- Start app in Docker container. Keep the foreground process running../start-tester.sh
- Start tester app in Docker container.
NOTE: The tester app should not crash. If it crashes, this mean something is not configured correctly. For example, ETCD stalling may cause configuration settings to be inconsistent inside the main app.
Use /run*.sh
script for local runs. Configurations needs to be updated since most
components will use the docker0
network interface otherwise.
- Start MySQL and ETCD containers as usual.
docker pull hyperworks/disk-filler
- This image is required by the tester.cd etcd
- Go to ETCD folder../seed-local.sh
- Seed configuration for local runs.cd ../app
- Go to app folder.export API_ENDPOINT=http://0.0.0.0:8080
- Points API endoint on local machine.export ETCD_ENDPOINT=http://0.0.0.0:2379
- Points ETCD endpoint on local machine../run.sh
- Starts the app../run-loader.sh
- Starts the loader (or tester withrun-tester.sh
).
To destroy all containers in your system and start over from scratch.
docker rm -fv `docker ps -aq`