All Products
Search
Document Center

Tair (Redis® OSS-Compatible):Switch the network type from classic network to VPC

Last Updated:Feb 17, 2025

Tair (Redis OSS-compatible) allows you to switch the network type of an instance from classic network to Virtual Private Cloud (VPC). This way, clients in the same VPC as the instance can communicate with the instance at higher security levels and lower network latency.

Prerequisites

The instance is deployed in the classic network.

Note

You can view the network type in the Basic Information section of the instance details page.

Impacts

  • After you switch the network type of an instance from classic network to VPC, you cannot switch it back to classic network.

  • The instance may experience a transient connection of a few seconds. We recommend that you perform this operation during off-peak hours and make sure that your applications can automatically reconnect to the instance.

Instance network types

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 client is deployed on an Elastic Compute Service (ECS) instance, you can connect the client to a Tair or Redis Open-Source Edition instance over a VPC to achieve higher security and lower network latency.

Classic network

Cloud services on the classic network are not isolated. Unauthorized access can be blocked only by using security groups or whitelists.

Note

If a client is deployed in a VPC and a Tair instance is deployed in the classic network, the client cannot connect to the instance. To connect the client to the instance, switch the network of the instance to the VPC of the client.

Procedure

  1. Log on to the console and go to the Instances page. In the top navigation bar, select the region in which the instance is deployed. Then, find the instance and click its ID.

  2. On the right side of the Connection Information section, click Switch to VPC.

  3. In the panel that appears, configure the parameters.

    切换为专有网络

    Parameter

    Description

    VPC Network

    Select the VPC and vSwitch that you want to use.

    Note

    If no VPC or vSwitch is displayed in the drop-down list, no VPC or vSwitch is available in the region or zone where the instance resides. For more information, see Create and manage a VPC and Create and manage a vSwitch.

    For example, if an instance is deployed in Hangzhou Zone E and no vSwitch is available after you select a VPC, no vSwitch is created for the VPC in Hangzhou Zone E. Create a vSwitch in Hangzhou Zone E and try again.

    vSwitch

    Retain the connection address of the classic network

    Specify whether to retain the classic network endpoint of the instance. Valid values:

    • Yes: allows the instance to use the classic network and VPC endpoints. The classic network endpoint remains unchanged. Clients can connect to the instance by using both endpoints. However, you must change the database endpoint on your client to the VPC endpoint before the classic network endpoint becomes invalid.

    • No: The VPC endpoint of the instance remains the same as the original classic network endpoint. You do not need to modify the connection string on the client. However, the client can connect to the instance only over the VPC and cannot connect to the instance over the classic network.

    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.

  4. Click OK.

FAQ

  • Why am I unable to select a vSwitch when I switch the network type of an instance?

    If no VPC or vSwitch is displayed in the drop-down list, no VPC or vSwitch is available in the region or zone where the instance resides. For more information, see Create and manage a VPC and Create and manage a vSwitch.

    For example, if an instance is deployed in Hangzhou Zone E and no vSwitch is available after you select a VPC, no vSwitch is created for the VPC in Hangzhou Zone E. Create a vSwitch in Hangzhou Zone E and try again.

  • An ECS instance and a Tair (Redis OSS-compatible) instance belong to the same VPC but reside in different vSwitches or zones. Can I connect the ECS instance to the Tair (Redis OSS-compatible) instance over the VPC?

    If the ECS instance and the Tair (Redis OSS-compatible) instance belong to the same VPC in the same region, network connectivity is not affected even if the instances reside in different vSwitches or zones. Make sure that the internal IP address of the ECS instance is added to the IP address whitelist of the Tair (Redis OSS-compatible) instance.

Related API operations

API operation

Description

SwitchNetwork

Switches the network type of an instance from classic network to VPC. If the instance is deployed in the classic network, the network type of the instance is switched from classic network to VPC.