Nowadays, modern DB engines like MongoDB, provide a cluster solution out of the box. Although MySQL offers some mainline products for clusterization like MySQL HA and MySQL NDB Cluster, the most used MySQL engine, the InnoDB, was lacking a similar solution. For a few years, MySQL has been working on the MySQL InnoDB Cluster. This solution allows InnoDB users to build a cluster to support node outage easily.
MySQL also provides some tools like MySQL-shell and MySQL-router that ease the cluster administration and usage.
What is Scope Creep and why is so related to our every day work? How does this still happens in many companies of different type of industries worldwide? How can we notice the full impact at a glance? Get every answer on our blog post.
We need three hosts to build a cluster. According to how the hosts were deployed, some initial tasks must be performed. To ease the reading, we are going to use three hosts to set up a cluster named MySQL-rep-1, MySQL-rep-2, and MySQL-rep3.
I used three different virtual machines to achieve this setup. You can use containers, but some extra tasks have to be taken, and that is beyond the scope of this blog post.
All the nodes we are going to use are deployed with an RH7 operating system. This way, all the commands written after this point are related to this operating system.
The tasks described in this section must be performed on every host that will be part of the cluster.
Verify the Hostnames
Each host must resolve every hostname to an IP address that does not correspond to the loopback one. It’s recommended to edit the file/etc/hosts and then remove every reference to the loopback address. Then, an entry should be added for each host involved in the cluster.
In this case, the contents of the file /etc/hosts was as shown in snippet 1.