A sidecar process written in Go to monitor MySQL slaves / masters for replication errors or lag.
Hi! and thanks for stopping by this project in it’s early days.
Inspired by GitHub’s interesting article: https://githubengineering.com/context-aware-mysql-pools-via-haproxy/
It’s similar to methods I’ve used previously to manage traffic being sent to Asterisk VoIP servers based on various metrics.
Ultimately, I’m pretty new to Go and thought this would be an interesting challenge and an awesome product if everything turns out well.
The initial iteration will handle reading YAML configuration, executing some basic checks against MySQL and presenting a JSON based endpoint for health checking against. After this iteration I should have a decent BVP - Barely Viable Product.
Let’s not get ahead of ourselves.
Percona master / slave for testing
I needed a really quick way to be able to: * Spin up a master and slave with replication configured * Create lag on the slave * Stop lag on the slave
To do this I’ve thrown together a really dirty
docker-compose file and a Makefile
with the following targets:
||Brings up the master, slave and sets up replication|
||Stops slave lag by setting
||Shows the current value of
||Does some SQL stuff - a
When running the containers you can access MySQL on host:
* Master Port:
* Slave Port:
Obviously: Please! Please! Please! Don’t ever use these settings or config In production (or any other application environment). This is for quick and dirty testing and development of
Simulating slave lag
To simulate slave lag for testing is super easy:
make upto bring up a master / slave and configure replication
make start-lagto start the slave lagging (up to 300s)
make stuffto do some SQL stuff and things
make slave-laga few times to see the lag increasing
make stop-lagstops the slave lagging