Updated on 2024-11-29 GMT+08:00

Backing Up Redis Data

Scenario

To ensure Redis data security routinely or before a major operation on a Redis cluster (such as upgrade or migration), you need to back up Redis cluster data. The backup data can be used to recover the system if an exception occurs or the operation has not achieved the expected result, minimizing the adverse impacts on services.

You can create a backup task on FusionInsight Manager to back up Redis cluster data. To prevent the Redis service from being severely affected, manually back up data.

Prerequisites

  • You have checked that HDFS services have been deployed in the current cluster.
  • The HDFS in the standby cluster has sufficient space. You are advised to save backup files in a custom directory.

Procedure

  1. On FusionInsight Manager, choose O&M > Backup and Restoration > Backup Management.
  2. Click Create.
  3. Set Name to the name of the backup task.
  4. Select the desired cluster from Backup Object.
  5. Set Mode to the type of the backup task. Periodic indicates that the backup task is periodically executed. Manual indicates that the backup task is manually executed.

    To create a periodic backup task, set the following parameters:

    • Started: indicates the time when the task is started for the first time.
    • Period: indicates the task execution interval. The options include Hours and Days.
    • Backup Policy: Only Full backup every time is supported.
      • AOF persistency is performed on full data when a backup task is executed on Redis. If the service data volume is large, the performance is greatly affected. You are advised not to periodically back up Redis data.
      • Manually back up Redis data during off-peak hours.

  6. In Configuration, select Redis.
  7. Set Path Type of Redis to a backup directory type.

    The following backup directory types are supported:
    • LocalHDFS: indicates that the backup files are stored in the HDFS directory of the current cluster.

      If you select this option, set the following parameters:

      • Target Path: indicates the HDFS directory for storing the backup files. The storage path cannot be an HDFS hidden directory, such as a snapshot or recycle bin directory, or a default system directory, such as /hbase or /user/hbase/backup.
        • The target path of Redis data backup cannot be set to the SM4 encrypted partition of HDFS.
        • The target path can be a path that does not exist in HDFS. A path will be automatically created during the backup.
      • Maximum Number of Backup Copies: indicates the number of backup file sets that can be retained in the backup directory.
      • Target NameService Name: indicates the NameService name of the backup directory. The default value is hacluster.

  8. Click OK.
  9. In the Operation column of the created task in the backup task list, click More and select Back Up Now to execute the backup task.

    After the backup task is executed, the system automatically creates a subdirectory for the backup task in the backup directory. The format of the subdirectory name is Backup task name_Data source_Task creation time.