Skip to content

Basic MySQL HA environment build with ProxySQL, Percona Heartbeat and Orchestrator

License

Notifications You must be signed in to change notification settings

garutilorenzo/mysql-ha-docker

Repository files navigation

GitHub issues MySQL HA CI GitHub GitHub forks GitHub stars

MySQL Logo

MySQL HA with ProxySQL Percona Heartbeat and Orchestrator

Basic MySQL HA environment, for advanced and custom configurations see:

  • ProxySQL - High performance, high availability, protocol aware proxy for MySQL
  • Heartbeat - Monitor MySQL replication delay
  • Orchestrator - MySQL high availability and replication management tool

Notes about environment

  • MySQL replication is setup with GTID

Setting up environment

Start environment with

docker-compose pull
docker-compose up -d

If you wish to rebuild the images locally run:

docker-compose -f .docker-compose.yml-ci build

or

docker build mysql/ -t garutilorenzo/mysql-gtid-replication:latest
docker build heartbeat/ -t garutilorenzo/heartbeat:latest

Show cluster status

ProxySQL

Via console:

docker-compose exec proxysql bash
root@proxysql:/# mysql -u admin -pproxysql -h 127.0.0.1 -P6032 -e \
    'select * from stats_mysql_connection_pool;'

Orchestrator

Via web Browser:

http://localhost:3000

Heartbeat

Via console:

docker-compose exec proxysql bash
root@proxysql:/# mysql -u super -Ap -h 127.0.0.1 -P3306 -e \
    'select * from percona.heartbeat;'
Enter password:

NOTE: all the cluster's password are defined in grants/users.sql

Clean all data

docker-compose down -v