Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Orchestrator on Raft (MySQL 8)

Example Docker Compose stack for ProxySQL/orchestrator with:

  • MySQL 8.0 primary + 3 replicas (GTID, official mysql:8.0 image)
  • 3 Orchestrator nodes in Raft HA (SQLite backend)
  • HAProxy routing HTTP only to the current Raft leader
  • ZooKeeper for Orchestrator KV (submit-masters-to-kv-stores)

No external MySQL-replication image is required. Replicas are wired with a small init script and GTID SOURCE_AUTO_POSITION.

Orchestrator lineage: Outbrain → Booking.com → GitHub → openark → Percona → ProxySQL (current maintainer).

Quick start

docker compose up --build

On first boot this will:

  1. Start MySQL 8 primary (db1) and configure a replication user
  2. Start three replicas (db2db4) and point them at db1 with GTID
  3. Form a 3-node Orchestrator Raft cluster
  4. Auto-discover db1 via the orchestrator-bootstrap one-shot service

UI (leader only, via HAProxy):

Direct node ports: 3331 / 3332 / 3333.

Topology check

docker compose exec orchestrator1 orchestrator-client -c topology --alias db1

Expected shape (versions will vary with the MySQL 8.0 patch level):

db1:3306   [0s,ok,8.0.x,rw,ROW,>>,GTID,P-GTID]
+ db2:3306 [0s,ok,8.0.x,ro,ROW,>>,GTID,P-GTID]
+ db3:3306 [0s,ok,8.0.x,ro,ROW,>>,GTID,P-GTID]
+ db4:3306 [0s,ok,8.0.x,ro,ROW,>>,GTID,P-GTID]

Or via the API / HAProxy:

curl -s http://127.0.0.1:8080/api/cluster/alias/db1 | jq .

Replication check

docker compose exec db2 mysql -uroot -ppassword -e "SHOW REPLICA STATUS\G" \
  | egrep 'Source_Host:|Replica_IO_Running:|Replica_SQL_Running:|Seconds_Behind_Source:'

Run only Orchestrator (no MySQL topology)

docker compose up --build orchestrator1

Credentials (demo only)

Role User Password
MySQL root root password
App DB test_user test_password (test_db)
Replication repl_user repl_password
Orchestrator topology root password

Layout

docker-compose.yml          # full stack
Dockerfile                  # ProxySQL Orchestrator from release tarball (v4.31.1)
docker/
  entrypoint.sh             # generates orchestrator.conf.json (Raft + SQLite + ZK)
  haproxy.cfg               # leader-only proxy via /api/leader-check
  bootstrap-discover.sh     # one-shot topology discovery
  mysql/
    primary.cnf             # GTID + binlog for primary
    replica.cnf             # GTID for replicas
    init-primary.sql        # creates repl_user
    init-replica.sh         # CHANGE REPLICATION SOURCE TO … SOURCE_AUTO_POSITION=1

Orchestrator version

The image installs the official ProxySQL/orchestrator release tarball (linux-amd64 / linux-arm64). Override with:

docker compose build --build-arg ORCHESTRATOR_VERSION=4.31.1

Notes

  • MySQL 5.7 support dropped — stack targets MySQL 8.0 only.
  • Replaces the old docker-mysql-replication image with the official MySQL image and a few conf/init files (GTID makes setup much simpler than file/pos dumps).
  • Fresh data directories are required for init scripts to re-run (docker compose down -v if you need a clean slate).
  • Demo credentials only — do not use this layout in production.

About

Orchestrator running in HA (Raft) with a testing MySQL cluster

Resources

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages