In this post, I will show how we can create a mariadb galera cluster of three nodes in Cent OS 6.x. This will bring you an idea of the setup and configurations and At the end I am sure you will be able to implement the same in other CentOS or RHEL distributions.

Overview of Galera Cluster MariaDB :

Galera cluster is a multi-master database setup which replicates the data synchronously among the nodes. Generally, we use MySQL or MariaDB server to create a Galera Cluster which uses Galera Replication plugin to replicate the data. It is always recommended to keep the “quorum mechanism” while setting up the galera cluster nodes. For more information on the “Quorum Mechanism”, have a look in the Galera Cluster Weighted Quorum Documentation.

Galera Cluster Setup in CentOS 6 :

The first step is to setup the MariaDB server in all the nodes of the cluster. Here’s how to install MariaDB server in centOS 6.x.

Setup Yum Repo at /etc/yum.repos.d/MariaDB.repo

name = MariaDB
baseurl =

To install MariaDB using Yum, run the commands below :

yum clean all
yum install MariaDB-Galera-server MariaDB-client galera
service mysql start

Run the command to check whether the MariaDB server is running successfully or not.

mysql -uroot -p<YOUR PASSWORD (IF ANY)>

Once you succeed in installing MariaDB, stop the service for now by using the command –

service mysql stop

Galera Cluster Configuration :

Go to /etc/my.cnf and check for the following configurations. Here I am considering that you are going to involve three nodes in the galera cluster… and the IP addresses are,,

I am providing a snapshot of the specific properties in my /etc/my.cnf configured for Galera Cluster –




Here the “wsrep_sst_auth” is the username:password of my MariaDB server. Make sure you put proper values at username:password against “wsrep_sst_auth” property.
The same /etc/my.cnf should be pasted in each of the nodes, just we have to change the values of “wsrep_cluster_name” and “wsrep_node_address”.

Get It Started :

The very first node, that is the “db1” should be started with below command –

/etc/init.d/mysql bootstrap

The other nodes should be started with the normal command like –

/etc/init.d/mysql start

While starting the other nodes, if you find the message like Starting MySQL….SST in progress, setting sleep higher. SUCCESS! , you are DONE !!! 👍

Check the Cluster Status :

Go to the “db1” and run –

$> mysql -uroot -p<YOUR PASSWORD>
MariaDB [(none)]> show status like 'wsrep%';

You will get to see the nodes’ IP and the port currently in the cluster.

wsrep_incoming_addresses |,,

Conclusion :

After reading this article I am sure you will be able to setup a Galera Cluster by your own. If you have any question, please feel free to ask me in the Comment section. Request you to Like and Share this article, if you have found it useful.

Read my other articles on Technology and Framework.


Please enter your comment!
Please enter your name here