How to Make One-Click Installation of a Scalable MySQL Cluster Package
MySQL database is a reliable and trusted technology, one of the most popular databases. It works perfectly well for both Windows and Linux and doesn’t have any restrictions on size storage. MySQL is used by big companies for many years. For example, Facebook, Twitter, Youtube, and Booking.com choose MySQL to keep their data. Such projects need to process a large number of requests at the same time and always stay uptime whether or not the traffic is high. To make your database work efficiently you should set up database replication or clustering. Unfortunately, configuring database clustering from scratch is time-consuming and requires many extra actions. Hidora helps you to skip all these additional steps and offers a one-click installation of a Scalable MySQL Cluster.
This package creates instances of MySQL server in the same network and configures asynchronous data replication. In addition, a dedicated MySQL load balancer, which is based on ProxySQL, is being installed in front of the database nodes to provide a centralized entry point to all the nodes of your cluster. Once you add more nodes to the cluster, they will be automatically attached to the load balancer, if you shrink the cluster, unnecessary nodes will be detached from it. We also pre-install a special tool, called Orchestrator, which offers different management and monitoring options for MySQL.
Let’s check the details on the Scalable MySQL Cluster solution implementation to understand clearly how it works.
The architecture of Scalable MySQL Cluster Package
Once you install MySQL cluster package, you will see an environment with the following architecture:
- 1 Load Balancer node based on ProxySQL and Orchestrator;
- 2 MySQL 5.7 nodes;
- The first MySQL node will have role “master”, the second one will have role “slave”, which means that all the data can be written directly only to the master node, while reads can be done both from master and slave;
- Default resource allocation either on ProxySQL or MySQL node is equal to 1 GiB of RAM and 3.2 GHz of CPU. We recommend increasing resource allocation for production databases up to 32 GB RAM and 96 GHz of CPU if needed.
Each MySQL cluster has the following features enabled:
- Efficient load balancing – ProxySQL is a smart layer that automatically distributes read-only (SELECT) queries to slave nodes and read-write queries to master node. This is a very helpful feature that allows to avoid manual management of reading and writing query distribution at the application level. Read requests are being distributed across slave nodes using round-robin algorithm.
- Scalability and autodiscovery – new MySQL nodes are automatically attached to the ProxySQL if you add more database nodes. These nodes will act as replicas/slaves. Moreover, every node is being automatically tuned to achieve maximum performance based on available RAM and CPU.
- Automated failover – Orchestrator monitors the state and metrics of all nodes and can automatically detach those slave DB nodes that are overloaded, e.g. nodes with high latency or the ones that are temporarily unreachable. Once a broken node becomes stable again, it is being automatically attached to the load balancer. As a result, your database queries will be executed only on healthy database nodes. In addition, you can manually promote any slave node to master using Orchestrator UI.
- Simple management using GUI – Using orchestrator you can manage different configuration options of MySQL, such as master-slave replication and slave-to-master promotion.
How to Install Scalable MySQL Cluster into Hidora Cloud
Hidora PaaS fully automates the deployment of the Scalable MySQL Cluster with Load Balancing and allows you to get a pre-configured and ready-to-go database cluster within minutes.
1. Log into your Hidora account, open Marketplace and find Clusters section. Click Install on the MySQL Auto-Cluster item.
2. Once the installation window is opened, you need to specify the name of environment that will be created during the installation process and click Install to proceed.
3. Wait for a while until Hidora installs and configures your MySQL Database Cluster.
After the installation process is completed, you will receive the notifications on your email address with all the necessary details on how to access to your MySQL cluster:
- Access to PHPMyAdmin panel for database managing;
- The information about the list of database replicas, which is needed to interconnect your application and the database;
- Credentials to access the Orchestrator panel for easy cluster management.
Now, you can start using your DB cluster and configure your application to work with it.