Database Clustering Tutorial 3 – Setting up a Database Cluster

How do you actually go about setting up a cluster? Well, unfortunately, it’s not the easiest process in the world. The good part, though, is that it is quite the learning experience, and it’s not really hard; it just takes some time.  

One of the reasons it can take so much time is because not everyone has a bunch of database servers laying around to setup a cluster.  But don’t worry.  I’m gonna teach you everything you need to know to set up a database cluster and start working with your data. I’ll also show you how to do it using virtual machines so you don’t have to set up a bunch of computers. To top it off, I’ll do it completely free of charge. Your welcome.

Infrastructure

Before we dive into setting up our database clusters, we first need to discuss our infrastructure. How are we going to set this up? Well, we are going to have one node per machine, and to make this of any use to use we will need at least two nodes. On top of this, we will need one machine to be the control panel (database management system is probably a better term), so that will mean having a third machine.


The reason we are going to set up the control panel as another machine is because it is what will be use to control the whole cluster. If we were to install it on one of the machines that have a node installed on it and then, for some reason, it exploded, we’ll not only lose access to that database node, but also the control panel for the entire cluster.  Bummer.

So we are going to be running 3 machines, one control panel, and two nodes that make our cluster.

Linux & Passwordless SSH

These are all going to be Linux machines. On one of the Linux machines we are going to install ClusterControl, which is the tool that makes this all easy for us.

Now, in order for ClusterControl to communicate with each node, the machine with ClusterControl needs a way to control all of the other computers. The way we do this is by setting up passwordless SSH to every node and to the machine that has ClusterControl.

Passwordless SSH is easy to set up once you know how to do it, and I’ll be guiding you through the process step by step.

Now, there are a ton of different databases out there all with there own way of setting up clustering. ClusterControl abstracts a lot of this detail away and makes our lives a lot easier. That’s great for me because I want to spend my time actually working with the databases, not setting junk up. That being said, we do need to consider the database of choice and the clustering technology just a bit.

Galera

I’m trying to generalize this series as much as possible so that we learn clustering, not just clustering for a specific database. I have, however, decided that the clustering technology of choice is going to be Galera. If you prefer a different cluster technology, ClusterControl can still meet your needs.

All of this will be done throughout this blog series, so stay tuned!  

In the next article we are going to learn about some more details about clustering and what Galera has to offer.

Further Study

Leave a Reply

Your email address will not be published. Required fields are marked *