Skip to content
Planned for v0.5

MariaDB Galera clusters, bootstrapped safely

Synchronous multi-node MariaDB for MySQL-compatible applications: three or more Galera members, a preferred-writer endpoint, mariadb-backup with binlog point-in-time recovery, and the dangerous parts of Galera, such as bootstrap and recovery after a full outage, handled carefully.
catalog-db, a MariaDB 12.3.3 Galera cluster with three members in staging: HAProxy on the members with writer and readers endpoints, a Galera primary component of three, stg-1 as the writer and two more synced nodes, with endpoints and metrics on the side.
catalog-db, a three-member Galera cluster. Interactive demo, simulated data. Open this screen in the demo

Topologies

  • Single: one MariaDB server with binary logs on, so point-in-time recovery works.
  • Galera: three or more members, an odd number recommended. Galera is quorum-based: a minority partition stops serving instead of diverging.
  • A lightweight Galera arbitrator as a witness, and ProxySQL, are planned for v1.1.

MariaDB 12.3 LTS is the default and 11.8 LTS is supported, with Galera 4.

A preferred writer, not a promise of one

Writing to several Galera members at once causes certification conflicts, so the writer endpoint (port 3307) sends writes to one member and moves them to another when it fails, with a design target of at most 10 seconds. It is a best-effort preferred writer, not a guarantee: HAProxy instances share the choice, and writes do not move back automatically. Multi-writer routing is available when your application handles conflicts.

The readers endpoint (3308) spreads reads across members, but those reads are not guaranteed to see the latest write; use the writer, or wsrep_sync_wait, when you need to read your own writes. The proxy passes real client addresses through, and secure transport is required.

Durable by default

The default strict durability flushes the log at every commit and syncs the binary log, so an acknowledged write survives a failover. New clusters require primary keys, which Galera needs to replicate safely, and state transfers between members always use TLS.

Bootstrap and recovery

Starting a new Galera cluster from one member is the classic way to lose data, so the bootstrap flag never appears in a command line: it is a single-use token tied to the cluster’s current generation. After a full outage the cluster recovers by itself only if every member’s position is known and the winner is unambiguous; otherwise it waits for a person. Forcing a minority to become primary is a critical plan.

Backups

mariadb-backup takes a full backup weekly and incrementals daily on a member that is not the writer, compressed and encrypted on the way to your repository. Two archivers copy the binary logs, flushing every five minutes, so you can restore to a point in time or a GTID, into a new cluster by default.

Day-2 operations and tools

  • Rolling restarts and minor upgrades, non-writers first.
  • Upgrades between LTS releases, rolling where MariaDB supports it, otherwise by restoring into a new cluster.
  • Adding and removing members, planned writer moves and online certificate rotation.
  • Users with presets, a SQL editor, the process list and a Galera page with flow control and certification failures.
  • Alert rules for a non-primary component, flow control, certification failures, writer disagreement and gaps in binlog archiving.

Know before you choose Galera

  • Only InnoDB tables are replicated.
  • Schema changes briefly block the whole cluster while they apply.
  • Very large transactions are limited by Galera’s write-set size.
  • Applications must retry when a transaction fails certification.

Status

MariaDB Galera is planned for v0.5. If the schedule gets tight, it is the first engine to move to v1.1.

Try the console before it ships

The interactive demo runs the whole console on simulated data. Trigger a failover, approve an AI assistant’s plan, restore a backup to a point in time. Nothing to install.