How to deploy a MariaDB Galera cluster on Ubuntu 14.04

Today we will show you about the deployment of MariaDB Galera Cluster on Ubuntu 14.04. MariaDB is an enhanced, drop-in replacement for MySQL while MariaDB Galera Cluster is a synchronous multi-master cluster for MariaDB. MariaDB Galera uses the Galera library for the replication implementation.

Its available only for Linux operating systems that only supports the XtraDB/InnoDB storage engines with its major features in Synchronous replication, automatic node joining, direct client connections and to read and write to any cluster node.

So the benefits with MariaDB Galera Cluster yields to many DBMS clustering solutions that includes clusters with no slave lag, no lost transactions and smaller client latencies. Let’s see how we are going to setup this on Ubuntu operating system by using three Ubuntu nodes.

Pre-Setup

We need at least 3 hosts running together with Ubuntu 14.04 Operating system to form a reliable cluster. The following is the hosts list that we had setup for this article, where we will deploy the MariaDB Galera cluster:

Now we will install the its required packages rsync, galera and mariadb-galera-server that need to be installed on all the three nodes.

Adding Repositories and Packages

Now we will start by adding the repository for Ubuntu so, first add the key files for the MariaDB repository to build the trust between the maintainers of repositories and that we can install the required packages.

Installing the GPG key

Run the following command of all the three hosts to install its GPG key as follow.

VSRep Providers Configurations

Here we will configure the vsrep configurations on each node under the [mysqld] directory by adding the following lines in /etc/mysql/my.cnf file on each node with their specific hostnames, root password and IP address.

Congratulations, the output on each of the node shows that you have successfully configured a MariaDB cluster with Galera.

Conclusion

In this detailed article we learned about the setup of MariaDB Galera Clustering using Ubuntu with three nodes with its step by step configurations on each node. So, keep in mind about the required changes while you are preparing your own MariaDB Galera clustering environment.