This setup provides a fault-tolerant MySQL cluster using Percona Server, ProxySQL for load balancing, and Orchestrator for automatic failover.
- 3x Percona Server 8.0.42-33: 1 Master + 2 Read-Only Slaves
- 1x ProxySQL 2.4.8: Load balancer and connection pooler
- 1x Orchestrator 3.2.6-9: Automatic failover management
-
Clone/create the directory structure with all configuration files
-
Start the cluster:
docker-compose up -d
-
Run the setup script that create the cluster:
./bootstrap/setup.sh
-
Test the cluster:
- Below script shutdown the cluster for 30 seconds to show that master failure and slave is promoted automatically
./tests/1-master-stop-start.sh
- Below script on master recovery rejoins as slave. It can be done maybe with hooks but for the test puruses implemented like this
./tests/2-rejoin-old-master.sh