$linuxjunkies
>

mariadb-galera(8)

MariaDB Galera Cluster server with multi-master synchronous replication for high availability and load distribution.

UbuntuDebianFedoraArch

Synopsis

mariadb-galera [OPTIONS]

Description

mariadb-galera is the MariaDB server binary configured for Galera Cluster mode, providing synchronous multi-master replication across multiple nodes. All nodes in the cluster stay synchronized, allowing reads and writes on any node with automatic conflict resolution.

Unlike traditional master-slave replication, Galera offers true multi-master capabilities where every node can accept writes simultaneously. If a node fails, the cluster automatically removes it and continues operating without data loss.

The server is typically started via systemctl or other init systems, with cluster configuration defined in /etc/mysql/conf.d/ or /etc/my.cnf.d/ files specifying wsrep parameters.

Common options

FlagWhat it does
--wsrep-new-clusterBootstrap a new Galera cluster; use on first node startup to initialize the cluster
--wsrep-cluster-addressSpecify the cluster address list (gcomm://node1,node2,...) for node discovery
--wsrep-node-nameSet the logical name of this cluster node for identification
--wsrep-node-addressSet the IP address this node uses for cluster communication
--wsrep-sst-methodState snapshot transfer method: rsync, xtrabackup-v2, or mysqldump
--wsrep-slave-threadsNumber of parallel threads applying replication events from other nodes
--binlog-format=ROWRequired row-based binary logging format for Galera compatibility
--default-storage-engine=InnoDBSpecify InnoDB as the default storage engine (required for Galera)
--skip-name-resolveSkip DNS lookups for faster cluster communication between nodes
--verboseEnable verbose logging to monitor cluster state transitions

Examples

Start MariaDB Galera server using the system init service with cluster configuration from /etc/my.cnf

systemctl start mariadb

Bootstrap the first node of a new Galera cluster named 'node1'

mariadb-galera --wsrep-new-cluster --wsrep-node-name=node1

Display Galera cluster status variables including node count and replication lag

mariadb -u root -p -e "SHOW STATUS LIKE 'wsrep%';"

Check cluster membership and node connectivity status

mariadb -u root -p -e "SELECT * FROM information_schema.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'wsrep_cluster%';"

Monitor real-time Galera cluster events and replication state changes in the log

tail -f /var/log/mysql/mariadb.log | grep -i wsrep

Verify and repair table consistency across all databases in the cluster

mariadb-check -u root -p --all-databases

Related commands