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

Prerequisites

The ApsaraDB for Redis instance runs in the classic network.
Note You can view the network type on the Instance Information 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.
  • The instance is disconnected for a few seconds. We recommend that you perform this operation during off-peak hours and make sure that your application can automatically reconnect to the instance.
  • 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 by using the classic network endpoint. You must change the database connection string on your client at the earliest opportunity.

Network types of ApsaraDB for Redis instances

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 to provide higher security and performance. If a Redis client is deployed on an Elastic Compute Service (ECS) instance, you can connect the client to an ApsaraDB for Redis instance over a VPC for higher security and lower network latency.
Classic network Cloud services in the classic network are not isolated. Unauthorized access to cloud services is blocked only by configuring security groups or whitelists.
Note If a client is deployed in a VPC and an ApsaraDB for Redis instance is deployed in the 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 of the ApsaraDB for Redis instance to the VPC of the client.

Procedure

  1. Log on to the ApsaraDB for Redis console.
  2. In the top navigation bar of the page, select the region where the instance is deployed.
  3. On the Instances page, click the ID of the instance.
  4. On the right side of the Connection Information section, click Switch to VPC.
  5. In the panel that appears on the right side of the page, set the parameters.
    Switch to VPC
    Parameter Description
    VPC Network 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 Create a VPC and Create a vSwitch.
    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 within a specified period of time. Clients can connect to the ApsaraDB for Redis instance by using both endpoints. However, you must change the database connection 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 by using the classic network endpoint.
    Retention Days Specify the retention period of the classic network endpoint. Unit: day. You can also modify the retention period after you switch the network type. For more information, see Modify the expiration date of a classic network endpoint.
  6. Click OK.

Related operations

Operation Description
SwitchNetwork Changes the VPC or vSwitch of an ApsaraDB for Redis instance. If the instance is deployed in the classic network, the network type of the instance changes from classic network to VPC.