Railway

Deploy MySQL HA

MySQL HA cluster with Group Replication and HAProxy entry point

Deploy MySQL HA

MySQL HA

A highly available MySQL cluster using:

  • MySQL Group Replication (single-primary, consensus built into mysqld)
  • HAProxy for client connections, routing writes to the current primary

Architecture

  • MySQL-1 (Primary): Current Group Replication primary (may change after failover)
  • MySQL-2+ (Replicas): Group members that elect a replacement on primary loss
  • MySQL HA (Edge): HAProxy entry point - use this for all client connections

Minimum 3 MySQL nodes: Group Replication is majority-based, so a 2-node group cannot survive a symmetric partition. 3 members tolerate 1 node loss.

Connecting

Use the MYSQL_URL or MYSQL_PUBLIC_URL from the "MySQL HA" (HAProxy) service. Do not connect directly to individual MySQL nodes.

Scaling

  • Replicas: even counts (2/4/6/8) via the cluster overview - the cluster totals 3, 5, 7 or 9 members, keeping the voter count odd (Group Replication caps membership at 9)

Template Content

More templates in this category

View Template
Garage S3 Storage
Ultra-light S3 server: fast, open-source, plug-and-play.

PROJETOS
7
View Template
Redis
Self Host Latest Redis with Railway

Arloodots
2
View Template
Postgres Backup to Cloudflare R2 (S3-Compatible)
Automated PostgreSQL backups to S3-compatible storage with encryption

Artour
7