GREEN PACKAGE SKILL · MYSQL 8.4 · GROUP REPLICATION

mysql-agy

3-node MySQL 8.4 Group Replication High Availability cluster on DigitalOcean with automated Floating VIP failover daemon and continuous R2 point-in-time recovery.

  • MySQL 8.4
  • Group Replication
  • Paxos Consensus
  • Floating VIP
  • R2 PITR

#Introduction

This package provisions a native 3-node MySQL 8.4 Group Replication cluster in Single-Primary mode. It automates primary election failover via a DigitalOcean Reserved IP (Floating VIP) and provides 1-minute binlog spooling with daily logical snapshots to Cloudflare R2.

Safe first steps./green build renders OpenTofu and Ansible templates locally, and ./green create --dry-run verifies execution boundaries without contacting cloud providers.

#Quick start

npx skills add https://github.com/getcolors/mysql-agy --skill package-mysql-agy-green
cp .agents/skills/package-mysql-agy-green/green ./green
./green build
./green create --dry-run
# After review:
./green create

#Architecture & Consensus

Node 1 (Primary)            Node 2 (Secondary)          Node 3 (Secondary)
┌───────────────────────┐  ┌───────────────────────┐  ┌───────────────────────┐
│ MySQL 8.4 Server      │  │ MySQL 8.4 Server      │  │ MySQL 8.4 Server      │
│ Group Replication GCS │──│ Group Replication GCS │──│ Group Replication GCS │
│ Floating VIP Daemon   │  │ Floating VIP Daemon   │  │ Floating VIP Daemon   │
│ 1-min Binlog → R2     │  │ Daily Snapshot → R2   │  │ Scratch Restore Drill │
└───────────────────────┘  └───────────────────────┘  └───────────────────────┘
           ▲
           │ (Dynamically Claimed by Primary via DO API)
    DigitalOcean Reserved IP (Floating VIP: 178.128.139.24)
           ▲
    Cloudflare DNS A-Record (mysql-agy.bigconfig.online)

#Floating VIP Failover

A lightweight systemd service (mysql-agy-endpoint) polls member status every 10s and reassigns the Floating Reserved IP dynamically to whichever node holds primary status.

#Backups & PITR

Binary logs stream every 60 seconds to Cloudflare R2 (mysql-agy-backup). Automated daily restore drills spin up a scratch MySQL instance to replay logs and assert zero transaction lag.

#Command Reference

CommandDescription
./green buildRender OpenTofu and Ansible configurations locally
./green create --dry-runValidate execution DAG and cloud resources without changes
./green createProvision infrastructure, converge cluster, and run acceptance tests
./green healthQuery Group Replication member states and lag metrics
./green deleteGuarded teardown (requires COLORS_PAR_COMPUTE_PREVENT_DESTROY=false)

#Safety & Credentials

  • All credentials indirected through gitignored COLORS_PAR_* environment variables.
  • Never export COLORS_PAR_PROFILE.
  • Protected by compute-prevent-destroy: true.