All Products
Search
Document Center

ApsaraDB for Redis:How to connect an ECS instance from a VPC to an apsaradb for Redis instance in classic network

Last Updated:Oct 15, 2021

Introduction

This topic describes how to connect an ECS instance in a VPC to a classic network apsaradb for Redis instance.

 

Background

A VPC and a classic network are two subnets. They cannot interconnect with each other over an internal network. You can solve this problem in the following ways.

  • If you allow changing the network type of the apsaradb for Redis instance, you can switch the apsaradb for Redis instance to the VPC where the ECS instance is located. For more information, see switch to VPC. You can also switch the network type of the apsaradb for Redis instance to VPC at the appropriate time to quickly connect both instances. However, you cannot change the network type of an apsaradb for Redis instance from classic network to virtual private cloud (VPC).
    Note: If you cannot select a vSwitch when switching networks, you can create a vSwitch in the VPC. The vSwitch must be in the same zone as the apsaradb for Redis instance. Afterward, switch to the VPC. For more information about how to create a vSwitch, see create a vSwitch.
  • If you do not allow changing the network type of the apsaradb for Redis instance, you have to purchase another ECS instance because the ECS instance and the apsaradb for Redis instance do not support switching from a VPC to a classic network classic network.
    Tips: you can find more solutions to connection problems in troubleshooting and solving connection problems.
  • You can request a public endpoint for an apsaradb for Redis instance and connect to the apsaradb for Redis instance from an ECS instance over the public network.
    Note: intranet connections provide high security and performance guarantee. Unless necessary, do not connect to the apsaradb for Redis instance over the Internet.
  • When you change the network type, if no switch is available, you can create a switch in the VPC. The switch stays in the same zone as the apsaradb for Redis instance. Afterward, switch to the VPC. For more information about how to create a switch, see create a switch.
  • To allow the ECS and apsaradb for Redis instances in different regions to interconnect with each other quickly, you can use the redis-shake tool to migrate the apsaradb for Redis instance to the region where the ECS instance is located.

 

Application scope

  • ApsaraDB for Redis