Site icon Database Tutorials

Mysql Galera Cluster for High Availability Solution

 

Steps to Install & Configure MySQL 3-Node Galera Cluster on CENTOS

Step 1: Enabling the Galera Cluster yum repositories.

 

Step 2: Install Galera and the prerequisite packages.

 

Step 3: Enable the Galera service to start at boot.

 

Step 4: Enable the service to start at boot & Start the firewalld service.

 

Step 5: Configure firewall exceptions to allow both replication and remote MySQL connections and reload the firewall.

 

Step 6: Configure SELinux to permissive mode for MySQL.

 

Step 7: Let us Configure my.cnf file.

 

Step 8: Repeat the above steps on each MySQL node that will participate in the MySQL Cluster. Be sure to alter the below fields in the /etc/my.cnf file to reflect the correct IP address and hostname that is applicable to each node.

 

Step 9 : Create the mysqld.log and give the mysql account the appropriate permissions on each node of the Galera Cluster.

 

Starting MySQL Cluster for the first time

Step 10: Start the MySQL on the first node, i.e node_alpha.

 

Step 11: After you installed MySQL 5.7 you will need to find the temporary password from /var/log/mysqld.log to login as root.

 

Step 12: Login to MySQL and run the below query to confirm the number of nodes in the cluster.

 

Step 13: Start MySQL on the other member nodes, node_beta and node_gamma. Notice the command to start the MySQL service is different on subsequent member nodes.

 

Step 14: Login to MySQL and run the below query again to confirm the number of nodes in the cluster has increased.

 

Step 15 : Let’s ensure all three node IPs are currently listed in wsrep_incoming_addresses. Disconnected nodes are normally removed from the replication automatically.

 

Step 16 : Let’s create a mysql user for State Snapshot Transfer(SST) and add below parameters in my.cnf file

 

At last restart the cluster nodes.

Exit mobile version