Help Center> Distributed Cache Service> FAQs> Instance Scaling and Upgrade> How Do I Upgrade a Single-Node or Master/Standby Redis 3.0 Instance?
Updated on 2023-09-08 GMT+08:00

How Do I Upgrade a Single-Node or Master/Standby Redis 3.0 Instance?

Background

Redis has not updated Redis 3.0 since the release of a minor version on May 19, 2019. Huawei Cloud DCS also announced the discontinuation of DCS for Redis 3.0 in March 2021.

You are advised to upgrade your Redis 3.0 to a later version as soon as possible. DCS for Redis 4.0/5.0/6.0 are compatible with Redis 3.0.

Follow the instructions below to upgrade a single-node or master/standby DCS Redis 3.0 instance by migrating data.
  1. The instructions apply only to upgrade from a single-node or master/standby DCS Redis 3.0 instance to a single-node or master/standby DCS Redis 4.0/5.0/6.0 instance.
  2. DCS Redis 3.0 instances support public network access, while DCS Redis 4.0/5.0/6.0 instances do not. If your services depend on public network access, do not perform the upgrade.
  3. Upgrading the Redis version through data migration may have the following impacts on services:
    • If you choose the full + incremental migration type, and the source and target instances have the same number of cached keys or the offset is small, services must stop writing data during incremental migration.
    • After data synchronization is complete, switch the domain name or IP address and the password (if the target and source instances have different passwords) for accessing Redis. Services must be stopped during the switch.
    • After switching the instance connection address and password, check whether services are running properly and whether key performance metrics are normal.
  4. Upgrade instances during off-peak hours.

Prerequisites

  • You have created a DCS Redis instance of a later version. This instance must be in the same VPC, of the same instance type, preferably configured with the same password as the source Redis 3.0 instance, and have specifications greater than or equal to the source instance.

    For example, to upgrade a 16 GB master/standby DCS Redis 3.0 instance to DCS Redis 5.0, prepare a master/standby DCS Redis 5.0 instance with at least 16 GB memory.

  • You have manually backed up data of the source DCS Redis 3.0 instance.

Migrating Data

  1. Log in to the DCS console.
  2. In the navigation pane, choose Data Migration. The migration task list is displayed.
  3. In the upper right corner, click Create Online Migration Task.
  4. Enter the task name and description.
  5. Configure the VPC, subnet, and security group for the migration task.

    Select the VPC where the source and target Redis instances are, so they can be connected with the task.

    The migration task uses a tenant IP address (Migration ECS displayed on the Basic Information page of the task). If the target Redis has a whitelist, this IP address must be added to the whitelist.

  6. After the migration task is created, click Configure in the Operation column of the task on the Online Migration tab page to configure the source Redis and target Redis.
  7. Select a migration type.

    Supported migration types are Full and Full + Incremental, which are described in Table 1.

    Table 1 Migration type description

    Migration Type

    Description

    Full

    Suitable for scenarios where services can be interrupted. Data is migrated at one time. Source instance data updated during the migration will not be migrated to the target instance.

    Full + incremental

    Suitable for scenarios requiring minimal service downtime. The incremental migration parses logs to ensure data consistency between the source and target instances.

    Once the migration starts, it remains Migrating until you click Stop in the Operation column. After the migration is stopped, data in the source instance will not be lost, but data will not be written to the target instance. When the transmission network is stable, the delay of incremental migration is within seconds. The actual delay depends on the transmission quality of the network link.

    Figure 1 Selecting the migration type

  8. If Migration Type is set to Full + Incremental, you can specify a bandwidth limit.

    The data synchronization rate can be kept around the bandwidth limit.

  9. Specify Auto-Reconnect. If this option is enabled, automatic reconnections will be performed indefinitely in the case of a network exception.

    Full synchronization will be triggered and requires more bandwidth if incremental synchronization becomes unavailable. Exercise caution when enabling this option.

  10. For Source Redis Instance, select the DCS Redis 3.0 instance to be upgraded.

    If the source DCS Redis 3.0 instance is password-protected, click Test Connection next to Source Redis Instance Password to check whether the instance password is correct and whether the network is connected.

  11. For Target Redis Instance, select the new higher version DCS Redis instance that you have prepared.

    If the target instance is password-protected, click Test Connection next to Target Redis Instance Password to check whether the instance password is correct and whether the network is connected.

  12. Click Next.
  13. Confirm the migration task details and click Submit.

    Go back to the data migration task list. After the migration is successful, the task status changes to Successful.

    • Once incremental migration starts, it remains Migrating.
    • To manually stop migration, click Stop.
    • After data migration, duplicate keys will be overwritten.

    If the migration fails, click the migration task and check the log on the Migration Logs page.

Verifying the Migration

After the migration is complete, use redis-cli to connect the source and target Redis instances to check data integrity.

  1. Connect to the source Redis and the target Redis.
  2. Run the info keyspace command to check the values of keys and expires.

  3. Calculate the difference between the values of keys and expires of the source Redis and the target Redis. If the differences are the same, the data is complete and the migration is successful.

During full migration, source Redis data updated during the migration will not be migrated to the target instance.

Switching the Redis Address and Verifying Services

  1. Change the domain name or IP address that your service uses to connect to Redis from that of the source Redis 3.0 instance to that of the new higher version instance.

    Figure 2 Obtaining the instance connection addresses

  2. If the password of the new instance is different from that of the original instance, change the password on the client.
  3. Verify that service functions are normal. For example, check whether an error is reported when the client accesses Redis.
  4. Check whether key performance metrics are normal, such as Connected Clients, Ops per Second, CPU Usage, and Memory Usage.

Instance Scaling and Upgrade FAQs

more