Grant all privileges on *.* to '%' identified by 'mypassword' Then you can create a MySQL user that you would use for the replication, you can use these commands here: grant usage on *.* to '%' identified by 'mypassword' Complete the secure MariaDB installation by running the following command (Please set a root password!): mysql_secure_installation Then please use this command here: /etc/init.d/mysql start Note! If you get the following error: Failed to start rvice: Unit not found Once it is installed, start the MariaDB service for all the servers: systemctl start msyql
Now to install MariaDB Galera cluster 10.0 and its dependencies on all the servers run: yum install MariaDB-Galera-server MariaDB-client rsync galera Then install the socat dependency package in all the 3 servers: yum install socat Once the default MariaDB library files have been removed, create the MariaDB repository file for all three servers: ~]# vim /etc//cluster.repo
Remove the default MariaDB library files for all the three servers ~]# yum remove mariadb-libs -y
Make sure to change the IP addresses to the IP addresses of your machines.Īs a side note, according to many sources, a good practice and also to keep a healthy Quorum, it's very important to always keep an odd numbers of Galera nodes. In my case the IP addresses of my 3 machines are: Server1: 192.168.201.90
To disable firewalld, run the following command as root: systemctl disable firewalldĬheck the Status of Firewalld systemctl status firewalld After reboot, confirm that the getenforce command returns Disabled: # getenforceĢ) Disable and Stop Firewalld. # targeted - Targeted processes are protected, # SELINUXTYPE= can take one of these two values: # disabled - No SELinux policy is loaded. # permissive - SELinux prints warnings instead of enforcing. # enforcing - SELinux security policy is enforced. # SELINUX= can take one of these three values: Configure SELINUX=disabled in the /etc/selinux/config file: # This file controls the state of SELinux on the system. Very important! Before you proceed please do the following or your setup might not work at all:ġ) Disable the Selinux service.
Here's a step by step guide on how to setup Galera Cluster on a new CentOS 7 server. If you want to do this for 10.1+ you can follow the steps at: Galera Cluster & MariaDB 10.1+ On CentOS 7 ServerĪfter a few hours of research I've came to the conclusion that there are more Ubuntu guides on how to set install and configure a Galera Cluster, so I've decided to write a step by step guide on how to do that on a CentOS 7 server. If you need to do that for older version you can follow the steps here.
This is available as a separate download for MariaDB 10.0 and MariaDB 5.5. Note! With MariaDB 10.1, the wsrep API for Galera Cluster is included by default. ( Source )įor more information, you could take a look at this official Galera Cluster for MySQL introduction video: Galera Cluster is an easy-to-use, high-availability solution, which provides high system uptime, no data loss and scalability for future growth. Galera Cluster for MySQL is a true Multimaster Cluster based on synchronous replication. Some overall info about the Galera Cluster solution. Install And Configure Galera MySQL Cluster On CentOS 7 Server