mariadb-galera(8)
MariaDB Galera Cluster server with multi-master synchronous replication for high availability and load distribution.
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
| Flag | What it does |
|---|---|
--wsrep-new-cluster | Bootstrap a new Galera cluster; use on first node startup to initialize the cluster |
--wsrep-cluster-address | Specify the cluster address list (gcomm://node1,node2,...) for node discovery |
--wsrep-node-name | Set the logical name of this cluster node for identification |
--wsrep-node-address | Set the IP address this node uses for cluster communication |
--wsrep-sst-method | State snapshot transfer method: rsync, xtrabackup-v2, or mysqldump |
--wsrep-slave-threads | Number of parallel threads applying replication events from other nodes |
--binlog-format=ROW | Required row-based binary logging format for Galera compatibility |
--default-storage-engine=InnoDB | Specify InnoDB as the default storage engine (required for Galera) |
--skip-name-resolve | Skip DNS lookups for faster cluster communication between nodes |
--verbose | Enable 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 mariadbBootstrap the first node of a new Galera cluster named 'node1'
mariadb-galera --wsrep-new-cluster --wsrep-node-name=node1Display 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 wsrepVerify and repair table consistency across all databases in the cluster
mariadb-check -u root -p --all-databases