A Disfunctional Docker (`pumba`)
Pumba lets you take ideas from previous tools and apply them in a container setting. This is useful since it can be used as part of existing tooling in your infrastructure.
Start off by spinning up some Docker containers to represent a system:
Then you can access system:
At this point, you can use Pumba to apply some 'tweaks' to the system.
Pause a Container
Here we pause 2/3rds of the storage containers in a PingCAP's distributed database:
Prior to running this command running CREATE DATABASE example;
will succeed nearly immediately. Running the same during the 15s failure window will delay this write operation until the system recovers.
Kill a Container
Send the main process inside a container the KILL signal:
Network Emulation
If your image doesn't have tc
installed, you need to run docker pull gaiadocker/iproute2
and use netem --tc-image gaiadocker/iproute2
instead of just netem
.
Introducing a delay to two of the storage nodes:
Introducing 99% packet loss on all three storage nodes:
Exercises
Try using the
--random
parameter to randomly select a node from passed set.Try using the regex syntax to target specific nodes.
Compare a true distributed system (like TiDB) against a traditional system (Postgres + Client).
Last updated