What is Galera Cluster
MariaDB Galera Cluster is a synchronous multi-master replication solution. All three nodes accept writes simultaneously. If one node fails, the cluster continues working. Ideal for high-availability applications.
Galera Configuration (each node)
[mysqld]
binlog_format=ROW
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so
wsrep_cluster_name="my_cluster"
wsrep_cluster_address="gcomm://10.0.0.1,10.0.0.2,10.0.0.3"
wsrep_node_address="10.0.0.1" # unique per node
wsrep_node_name="node1" # unique per node
wsrep_sst_method=rsyncBootstrap Cluster (node1 only)
sudo galera_new_clusterStart Remaining Nodes
sudo systemctl start mariadbCheck Cluster Status
mysql -u root -p -e "SHOW STATUS LIKE 'wsrep_%';" | grep -E "cluster_size|cluster_status|ready"Never run galera_new_cluster again after initial setup — it creates a new empty cluster and wipes all data.