MariaDB Galera Cluster

= Introduction = This is a guide for configuring a 3 node MariaDB Galera Cluster.

A MariaDB Galera cluster requires a minimal of 3 nodes. However, one of the members of the cluster can be an arbitrator (2 node + 1 arbitrator). Despite not participating in data replication, the arbitrator still needs to be on a 3rd physical node.

= Design = The Maria Galera Cluster is multi master cluster featuring synchronous writes across all nodes. Each node requires a static IP address to function.

If you have a local dns server, you can make use of that. else make use of your hosts file. This will make your system clear about the other nodes and ip address.

= Packages = Please add the garbd useflag, if you have 3 node, you can skip this useflag.

Please emerge the following package

= Database Initialization = Run this command and keyin your mariadb root password

= Setup Mariadb and Galera =

Start mariadb on Node1
If everything is running smoothly, start the next node and on.

Checking if all node are join and running correctly
try to run this command from node 1

If the cluster size is equal to you node size you are good to go. And wsrep_ready meant the cluster is ON.

Garbd Arbitrator Configuration
= Finalize configuration = The Mariadb cluster is now up. We still need to make some final change.

Add services using rc-update on all node
= Secure mariadb = Secure your mariadb for production use

= External Reference =