Our most favoured method of deploying Galera Clusters via Galera Manager happen to be the on-premise option, which is favoured by our customers and users. We have always been under the impression that the cloud deployments (AWS, DigitalOcean) would have more pull, but majority do prefer an on-premise installation. We have also made an appropriate video: A step-by-step video on how to install Galera Cluster on premises using Galera Manager.
So to start, we will deploy 3 hosts, running CentOS 7. These are just deployed with the base operating system (OS). And of course, you need another host to run your Galera Manager, so in total we have four (4) hosts. Obtain Galera Manager via filling in the form.
Once you have the gm-installer on your Galera Manager host, remember to execute: chmod +x gm-installer
Then you can verify the version: ./gm-installer version
gm-installer version 1.9.3 (linux/amd64)
And to get started, execute: ./gm-installer install
Accept the license agreement, enter the admin password, enter the IP (means you get a install over HTTP) or hostname (this install then executes over HTTPS), and you’re on your way to getting your Galera Manager host installed.
Typically this installation process takes between 5-10 minutes, as it has to pull in packages from multiple repositories. Yes, it goes without saying, the current install method requires access to the Internet (we do not support an offline install mode). It is also important to ensure that if you have a firewall, to open up TCP ports 80, 8081. 443 will also apply if you’re using HTTPS.
You will now see the login screen, fill in your credentials that you entered on the command line earlier.
As you can see, by default there are no clusters, and when you click on it, you are given options to deploy a fully managed cluster, or to deploy a cluster on user-provided hosts, and finally just to monitor an existing cluster. For the purpose of this document, we are going to take option 2, which is “Deploy cluster on user-provided hosts”. This is in minute four of the video.
You now have to create the cluster type, and what database engine you are choosing. Don’t forget to give your cluster a name! Galera Manager can manage multiple clusters in one instance.
Almost immediately after, you’re told to copy the SSH keys into every host you plan to deploy to. A point to note, is that if you select the copy icon, and do this over HTTP, you will get an error saying, “Couldn’t copy public key”; this is a security measure, as the copy functionality only works over HTTPS. You will actually have to select, and manually copy the SSH key using Ctrl+C/Command+C, etc. You have to have this SSH key on all hosts in /root/.ssh/authorized_keys. Only once you have ticked “I have added public key to /root/.ssh/authorized_keys file on all nodes” can you move on in the installation. This is in minute 4.45 of the video.
Now it is time to click: Add node. The popup should now enable you to add an SSH address, and don’t forget to give it a node name. One thing we like to ensure is that the SSH access is working, so you really should click Check Access and ensure that the SSH connection is working sufficiently. Then go right ahead and Deploy. This is at 5:55 in the video.
This is a blocking operation, and you can only deploy each node one-by-one. Repeat the process for nodes 2 and 3.
Voila! You now have a 3-node Galera Cluster, deployed by Galera Manager, and one you can fully manage through the GUI. This is in the 19th minute of the video.
You can SSH into any of your hosts, and you will be able to login without a password, and execute mysql to login.
mysql> select version(); +-----------+ | version() | +-----------+ | 8.0.30 | +-----------+ 1 row in set (0.00 sec) mysql> show status like 'wsrep_cluster_size'; +--------------------+-------+ | Variable_name | Value | +--------------------+-------+ | wsrep_cluster_size | 3 | +--------------------+-------+ 1 row in set (0.00 sec)
With Galera Manager, you can also stop the node, restart it, delete a node, but better yet, you can also have a browser-based SSH Terminal. Naturally you can add monitoring metrics, change the frequency, and so much more.
Happy deploying Galera Clusters with Galera Manager!