Create Cluster from Backup
The Create Cluster from Backup feature is a feature in ClusterControl with relevant approach to how you will deploy using Create Database Cluster method. With this method, users are given the option to easily create a new cluster from a backup, eliminating hassle, reducing time consumption, and minimizing errors. It also enables easy scalability and ensures idempotency with just a few clicks. This feature provides an intuitive workflow for configuring high-availability setups, replication, load balancing, and more.
Similar to Create Database Cluster, you can:
- Provisioning of a new cluster.
- Clone an exising cluster and re-deploy to a new cluster. Helpful especially you need to build a quick QA, staging, or dev environment.
- Create a copy of an existing cluster and migrate to a new cloud environment.
- Built-in validation to test on a different environment or operating system to achieve a rapid outcome.
This guide provides step-by-step instructions on how to create a cluster from backup using ClusterControl.
Support Matrix
Currently, using the GUI, there's only one suupported cluster in ClusterControl. See below:
Database | Vendor | Topology |
---|---|---|
Galera Cluster | MariaDB, Percona | Galera certification-based replication |
Prerequisites
- Backup should be created using ClusterControl and from an existing cluster.
- Backup should be from a Galera Cluster.
- Only MariaDB Galera and Percona XtraDB Cluster are the types of cluster supported.
- You have sufficient storage space for the target environment. Make sure that the new environment or target nodes has enough disk space to copy and restore the backup.
- Network interoperability between the source of backup (either from an existing cluster node or from the ClusterControl controller host) down to your target environment.
- Ensure that you have appropriate user permissions and privileges on the target environment. If security kernel modules such as AppArmor or SELinux must be enabled, make sure you have appropriate configuration to allow the operation successful.
Creating the Cluster from Backup
There is only one method to create a cluster from backup using ClusterControl. As mentioned above, only Galera Cluster is supported to achieve this job.
Galera Cluster
There is only one method to accomplish the job. The step-by-step in the following section will guide you on hwo to achieve this.
Deployment Steps
-
Go to the Clusters dashboard. Choose your target source cluster then click.
-
Go to the Backups tab.
-
By default, the All Backups view shall be displayed. Otherwise, make sure you click the All Backups view.
-
In the list of backups, select the backup you desire to be the source of data to stage the cluster and click the ellipsis button (...).
-
Select and click Create cluster.
-
First step is Cluster details. This provides you the backup information, fields to define the name of your cluster, and tags.
-
Backup. This field shows the selected backup that was created successfully.
-
Method. This is a panel view where it displays the information of the backup such as, the backup method used, size, host taken, and when it was created.
-
Under Name your cluster panel, there are two fields you can specify:
-
Fill-in the Name of the cluster you want to assign. (Optional)
-
Add Tags to search or group your database clusters. (Optional)
-
-
-
Click Continue.
-
Second step is SSH Configuration. This is where you have to define the SSH connection details to have network interoparibility between the ClusterControl controller, existing cluster, and the target environment for your new cluster.
-
SSH user. Specify root if you have root credentials if you use sudo to execute system commands, specify the username that you wish to use here. The user must exists on all nodes.
-
SSH user key path. Specify the full path of SSH key (the key must exist in ClusterControl node) that will be used by SSH User to perform passwordless SSH.
-
SSH port. Specify the SSH port for target nodes. ClusterControl assumes SSH is running on the same port on all nodes.
-
SSH sudo password. Specify the password if the SSH user that you specified under SSH User requires sudo password to run super-privileged commands. Ignore this if SSH User is root or have no sudo password.
-
Install software is set to On. You can disable this if you do not want to install the software if the package is already installed. If set to On, ClusterControl will uninstall any existing package found and install the right package and version of the database instead.
-
Security configuration to either disable firewall or SELinux/AppArmor. Leave check if you need to Disable firewall (default). Leave check if you need to Disable SELinux/AppArmor (default). Otherwise uncheck if any of the two needs not be disabled. If you have uncheck Disable SELinux/AppArmor, make sure that you have configured properly to allow creating files and opening sockets for the database to run properly.
-
-
Click Continue.
-
Third step is Node configuration.
- Specify the Server Port of your MySQL service. Default is set to 3306.
- Specify the Server data directory is set to
/var/lib/mysql
. If you have prepared a separate path or on a different volume, replace the value with your custom path. - Admin/Root user. The database admin username that ClusterControl shall configure on all database nodes. This user will be granted global SUPER privilege and the GRANT option for localhost only.
- Admin/Root password. The password for Admin/Root user.
- Repository. Choose "Use vendor repositories" (default) will let ClusterControl provision software by setting up and using the database vendor's preferred software repository. ClusterControl will always install the latest version of what is provided at that moment. Choose "Do not setup vendor repositories" if you have a special configuration from the vendor (commonly for enterprise databases) and ClusterControl will skip the repository configuration part.
- Version. Make sure that the cluster of the source backup should match the version specified here.
- Configuration template. The dropdown loads all MySQL configuration template files under
/etc/cmon/templates
or/usr/share/cmon/templates
of the ClusterControl node for this cluster type. Choose one configuration template for the deployment. SeeĀ Configuration Template. - Enable SSL encryption. Toggle on (default) will instruct ClusterControl to configure database SSL encryption for both client-server and replication. Toggle off will make ClusterControl skip this step.
-
Fourth step is Add nodes.
- Galera node. Type the IP address/hostname or valid FQDN of the nodes you want to assign for this new cluster. Please note that an odd number of nodes is recommended, i.e., 3, 5, 7, etc.
-
Click Continue to proceed the last step Preview.
-
The last step is Preview, this is the last step where it shows all the values and choosen options for the ClusterControl to use for setting up the backup.
-
Create a three-node Percona XtraDB Cluster using version 8.0 from an existing backup.
s9s cluster \ --create \ --cluster-type=galera \ --nodes="192.168.40.67?master;192.168.40.68?master;192.168.40.69?master" \ --vendor=percona \ --cluster-name=pxc_stage_env \ --provider-version=8.0 \ --backup-id=466 \ --os-user=vagrant \ --os-key-file=/home/vagrant/.ssh/id_rsa \ --wait \ --log
- where
--nodes="192.168.40.67?master;192.168.40.68?master;192.168.40.69?master"
are the ip address of the target nodes. --cluster-name=pxc_stage_env
parameter is the name of the cluster.--provider-version=8.0
defines the version of the PXC to be installed.--backup-id=466
defines the selected backup ID for the source backup to be used to create the cluster. The backup ID can be located in the All Backups list view.--os-user=vagrant
and--os-key-file=/home/vagrant/.ssh/id_rsa
defines the OS user and its path of its public key- where the
--wait
and--log
as the name suggest to print the job logs while waiting.
- where