You can switch the network type of an ApsaraDB for Redis instance from classic network to virtual private cloud (VPC). Then, clients can communicate with the ApsaraDB for Redis instance within the same VPC. This ensures higher security and lower network latency.

Prerequisites

The ApsaraDB for Redis instance runs in a classic network.
Note You can view the network type on the page of the instance.

Impacts

  • After you switch the network type of an ApsaraDB for Redis instance from classic network to VPC, you cannot switch back to classic network.
  • When you switch the network type, you can specify whether to retain the classic network endpoint of the instance. If you do not retain the classic network endpoint of the instance, the endpoint is released after the network type is switched. Then, clients cannot connect to the ApsaraDB for Redis instance through the classic network endpoint. You must change the database connect string on your client at the earliest opportunity.

Network types of the instance

Network type Description
VPC (recommended) A VPC is a private network dedicated to your Alibaba Cloud account. VPCs are logically isolated from each other at Layer 2 and provide higher security and performance. When a Redis client is deployed on an Elastic Compute Service (ECS) instance, you can connect to an ApsaraDB for Redis instance through a VPC for higher security and lower network latency.
Classic network Cloud services in a classic network are not isolated. Unauthorized access to cloud services is blocked only by security groups or whitelists.
Note If a client is deployed in a VPC and an ApsaraDB for Redis instance is deployed in a classic network, the client cannot connect to the ApsaraDB for Redis instance. To connect the client to the ApsaraDB for Redis instance, switch the network type of the ApsaraDB for Redis instance to the VPC of the client.

Procedure

  1. Log on to the ApsaraDB for Redis console.
  2. On the top of the page, select the region where the instance is deployed.
  3. On the Instance List page, click the Instance ID of the instance.
  4. On the right of the Connection Information section, click Switch to VPC Network.
  5. In the dialog box that appears, set the following parameters.
    Switch to VPC
    Parameter Description
    VPC Select the VPC and vSwitch that you want to use.
    Note If no VPC or vSwitch is available in the drop-down list, create a VPC and a vSwitch. The vSwitch and the ApsaraDB for Redis instance must belong to the same zone. For more information, see Work with VPCs and Work with vSwitches.
    VSwitch
    Retain the connection address of the classic network Specify whether to retain the classic network endpoint of the ApsaraDB for Redis instance:
    • Yes: allows the instance to use both the classic network and VPC endpoints. Clients can connect to the ApsaraDB for Redis instance through both endpoints. However, you must change the database connect string on your client to the VPC endpoint before the classic network endpoint becomes invalid.
    • No: releases the classic network endpoint. Clients cannot connect to the ApsaraDB for Redis instance through the classic network endpoint.
    Retention Days Specify the number of days for which the classic network endpoint is retained. After you switch the network type, you can also modify the retention period. For more information, see Change the expiration time for the connection address of a classic network.
  6. Click OK.

Related API operations

API operation Description
SwitchNetwork Switches the network type of an ApsaraDB for Redis instance from classic network to VPC.