Create an instant backup of a MySQL database automatically

Create an instant backup of a MySQL database automatically

After you create a backup schedule as described in Enable a backup schedule for a MySQL database, you may also need to create an instant backup of a MySQL database.

To create an instant backup automatically:

  1. Log in to the Jenkins web UI.

  2. Open the Galera database backup pipeline.

    1. Specify the required parameters:

      Galera database backup parameters

      Parameter

      Description and values

      SALT_MASTER_URL

      Define the IP address of your Salt Master node host and the salt-api port. For example, http://172.18.170.27:6969.

      SALT_MASTER_CREDENTIALS

      Define credentials_id as credentials for the connection.

      OVERRIDE_BACKUP_NODE

      Fill in the name of the node to back up if you want to override the automatic node selection. The default value is none that triggers the automatic node selection workflow.

    2. Click Deploy.

      The pipeline workflow:

      1. Primary component location and node selection. The pipeline locates the current primary component and selects one of its nodes to use as a source of data for the backup.

        Note

        The pipeline skips this stage if the OVERRIDE_BACKUP_NODE parameter is defined with a preferred node name.

      2. Backup preparation. Several necessary steps are run to verify that the openssh and xtrabackup states are up to date.

      3. Backup.

      4. Cleanup. The cleanup script is triggered to clean the temporary directories and old backups.

  3. Verify that the backup has been created and, in case of the remote backup storage, moved correctly.