How to Set Up MariaDB Galera Cluster for High Availability
Galera Cluster provides synchronous multi-master replication for MariaDB. Set up a cluster across multiple Breezes for automatic failover and high availability.
Install MariaDB with Galera
# On each node (Ubuntu/Debian)
sudo apt update
sudo apt install -y mariadb-server galera-4
Configure the First Node
# /etc/mysql/mariadb.conf.d/99-galera.cnf
[mysqld]
binlog_format=ROW
default_storage_engine=InnoDB
innodb_autoinc_lock_mode=2
# Galera settings
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so
wsrep_cluster_name="breeze-cluster"
wsrep_cluster_address="gcomm://NODE1_IP,NODE2_IP,NODE3_IP"
wsrep_node_address="NODE1_IP"
wsrep_node_name="breeze-node1"
wsrep_sst_method=rsync
Bootstrap the Cluster
# On the first node only
sudo galera_new_cluster
# Verify cluster size
mysql -u root -e "SHOW STATUS LIKE 'wsrep_cluster_size';"
Join Additional Nodes
# On node 2 and node 3, after configuring 99-galera.cnf
sudo systemctl start mariadb
# Verify on any node
mysql -u root -e "SHOW STATUS LIKE 'wsrep_%';" | grep -E "cluster_size|connected|ready"
Testing Replication
Create a table on node 1 and verify it appears on nodes 2 and 3 immediately. Galera provides synchronous replication, so all nodes stay consistent. Monitor wsrep_local_state_comment — it should show Synced on every node in your Breeze cluster.