Setting up a Galera MariaDB Cluster

How to setup a Galera MariaDB Cluster

Remove any existing packages:

Update:

Add the official repo for MariaDB by creating the file /etc/yum.repos.d/MariaDB.repo

Now install MariaDB:

Setup MariaDB:

To generate the CA certificate:

To generate the server certificate, remove passphrase, and sign it:

(Optional) To generate the client certificate, remove passphrase, and sign it:

Edit the file: /etc/my.cnf.d/server.cnf

In the file above the line “wsrep_sst_receive_address=’x.x.x.x'” is required if any of the nodes are behind a NAT router on private IP addresses, where x.x.x.x is the public IP address of the router. Without this SST donors will try to send snapshot data to the nodes private IP address which will invariably fail.

The “wsrep_provider_options” are tailored to for nodes that talk to each other over a WAN (i.e. the internet). If your nodes are all on the same LAN then you can leave this option out completely – it adjusts some timeout default values to better cope with varying connectivity quality across a WAN.

Start the primary node:

Start the other nodes:

Login to any of the nodes and check status: