Problem
Keepalived only tracks the mysqlrouter process via killall -0 mysqlrouter. If other critical components fail (Superset, Redis, Docker Swarm), the VIP stays on the unhealthy node and traffic is routed to broken services. The Docker healthcheck in docker_compose.yml only affects container status — it does not trigger VRRP failover.
File: services/mysql-mgmt/keepalived.conf.tpl
Impact
| Component failed |
Detected before |
Detected after |
VIP failover? |
| MySQL Router process |
✅ |
✅ |
✅ |
| MySQL Router unresponsive |
❌ |
✅ |
✅ |
| Docker daemon |
❌ |
✅ |
✅ |
| Superset service |
❌ |
✅ |
✅ |
| Redis |
❌ |
✅ |
✅ |
Fix
Create services/mysql-mgmt/healthcheck.sh:
#!/bin/bash
killall -0 mysqlrouter 2>/dev/null || exit 1
mysqladmin --login-path=superset --port=6446 ping 2>/dev/null || exit 1
docker info > /dev/null 2>&1 || exit 1
docker service inspect superset --format '{{.Spec.Name}}' 2>/dev/null | grep -q superset || exit 1
docker exec redis redis-cli ping 2>/dev/null | grep -q PONG || exit 1
exit 0
Update keepalived.conf.tpl to use it with interval=5, weight=-20, fall=3, rise=2.
Acceptance Criteria
Problem
Keepalived only tracks the
mysqlrouterprocess viakillall -0 mysqlrouter. If other critical components fail (Superset, Redis, Docker Swarm), the VIP stays on the unhealthy node and traffic is routed to broken services. The Docker healthcheck indocker_compose.ymlonly affects container status — it does not trigger VRRP failover.File:
services/mysql-mgmt/keepalived.conf.tplImpact
Fix
Create
services/mysql-mgmt/healthcheck.sh:Update
keepalived.conf.tplto use it withinterval=5,weight=-20,fall=3,rise=2.Acceptance Criteria
healthcheck.shcreated covering: mysqlrouter process, mysqladmin ping via Router, docker daemon, superset swarm service, redis pingkeepalived.conf.tplupdated to usehealthcheck.shwithinterval=5,weight=-20,fall=3,rise=2Dockerfilecopieshealthcheck.sh;docker_compose.ymlinit container copies it to named volume