Mariadb HIgh-availibility cluster Centos7

Published by as_blog_ad on

High availability is a basic requirement in any production database setup. Galera provides rich features for High availability and scalability in a MariaDB/Mysql.

  • Synchronous replication
  • Active-active multi-master topology
  • Read and write to any cluster node
  • Automatic membership control, failed nodes drop from the cluster
  • Automatic node joining
  • True parallel replication, on row level
  • Direct client connections, native MariaDB look & feel



Step1: Add MariaDB Repo

Step2: Install Required Packages for Galera setup.

Step3: Start Mysql service and run the secure installation.

Step4: Copy myserver.cnf t a backup file as we will be editing the file in order to set up our Galera cluster.

Step5: Edit the server.cnf and add the following lines.


Step6: Installing SELinux packages and allow Mysql ports required for Galera.

Step7: Allow Ports in the firewall.

Step8: Initialize Galera


Step9: Verify Mysql ports are listening using netstat command.


Setup Slave.


Add MariaDB repo on the slave.

Install the required packages.

Initialize MariaDB


Truncate server.cnf and add contents.

Update SELinux POlicy.

Update firewall Rules

Start MariaDB


Verify WSREP is running and data is being synced.