This topic describes how to configure a hybrid access solution to smoothly migrate an RDS instance from the classic network to a VPC. To meet the increasing needs of migration between different network types, ApsaraDB for RDS introduces the hybrid access solution. This solution enables a smooth migration from the classic network to a VPC without any transient disconnections or service interruptions. The solution also offers the option to migrate a primary instance and its read-only instances separately without any interference with each other.

Background information

In the past, when migrating an RDS instance from the classic network to a VPC, the internal endpoint of the RDS instance changes. The connection string of the RDS instance remains the same but the IP address bound to the connection string is changed to the corresponding IP address in the VPC. This change will cause a 30-second transient disconnection, and the ECS in the classic network cannot access the RDS instance through the internal endpoint within this period. To migrate the RDS instance across different networks in a smooth manner, ApsaraDB for RDS introduces the hybrid access solution.

Hybrid access refers to the ability of an RDS instance to be accessed by ECS on both the classic network and VPC. During the hybrid access period, the RDS instance reserves the original internal endpoint of the classic network and adds an internal endpoint of VPC. This prevents transient disconnections during the RDS database migration.

For better security and performance, we recommend that you use the internal endpoint of VPC only. Therefore, hybrid access is available for a limited period of time. The internal endpoint of the classic network is released when the hybrid access period expires. In that case, your applications cannot access the RDS database by using the internal endpoint of the classic network. You must configure the internal endpoint of VPC in all your applications during the hybrid access period. This can guarantee smooth network migration and minimize the impact on your services.

For example, your company wants to use the hybrid access solution to migrate RDS instances from the classic network to a VPC. During the hybrid access period, some applications can access the database through the internal endpoint of the VPC, and the other applications can access the database through the original internal endpoint of the classic network. When all the applications access the database through the internal endpoint of the VPC, the internal endpoint of the classic network can be released. The following figure illustrates the scenario.


Seamless migration from classic network to VPC

Limits

During the hybrid access period, the instance has the following limits:

  • Switching to the classic network is not supported.
  • Migrating the RDS instance to another zone is not supported.

Prerequisites

  • The network type of the instance is the classic network.
  • Available VPCs and VSwitches exist in the zone where the RDS instance is located. For more information about how to create VPCs and VSwitches, see Manage VPCs.

Migrate the RDS instance from the classic network to a VPC

  1. Log on to the ApsaraDB for RDS console.
  2. In the upper-left corner of the page, select the region where the instance is located.
    Select a region
  3. Find the instance and click the instance ID.
  4. In the left-side navigation pane, click Database Connections.
  5. Click Switch to VPC.
  6. In the dialog box that appears, select a VPC and VSwitch, and select whether to retain the internal and public endpoints of the classic network.
    • Select a VPC. We recommend that you select the VPC where your ECS instance is located. Otherwise, the ECS instance and RDS instance cannot communicate through the internal connections unless you create an express connection or gateway. For more information, see Express connection and VPN gateway.
    • Select a VSwitch. If no VSwitch exists in the selected VPC (as shown in the following figure), create a VSwitch in the same zone as the instance. For more information, see Manage VSwitches.
      选择虚拟交换机
    • Decide whether to select Retain Classic Network. The following table describes the different actions.
      Action Description
      Clear

      The endpoint of the classic network is not retained. The original endpoint is changed to the endpoint of the VPC.

      If the endpoint of the classic network is not retained, a 30-second transient disconnection will occur to the RDS instance when the network type is changed. The internal access to the RDS instance from the ECS instance that is located in the classic network will be immediately disconnected.
      Select

      The endpoint of the classic network is retained, and a new endpoint of the VPC is added. Indicates that the hybrid access mode is used and RDS can be simultaneously accessed by ECS instances both in the classic network and VPC through the internal endpoints.

      If the endpoint of the classic network is retained, the RDS instance will not be immediately disconnected when the network type is changed. The ECS instances in the classic network will not be disconnected from the internal access to the RDS instance until the internal endpoint of the classic network expires.

      Before the endpoint of the classic network expires, add the endpoint of the VPC to the ECS instance that is located in the same VPC. This makes sure that your business is smoothly migrated to the VPC. Within seven days before the endpoints of the classic network expire, the system will send a text message to the mobile phone bound to your account every day.


      数据库连接
  7. Add the internal IP address of the ECS instance in the VPC to the VPC whitelist group of the RDS instance. This makes sure that the ECS instance can access the RDS instance through the internal network. If no VPC whitelist group exists, create a new group.
    将ECS实例内网IP地址添加到RDS实例的白名单
    • If you select Retain Classic Network, add the endpoint of the VPC to the ECS instance before the endpoint of the classic network expires.
    • If you clear Retain Classic Network, the internal connection from the ECS instance in the VPC to the RDS instance is immediately disconnected after the network type is changed. You must add the RDS endpoint of the VPC to the ECS instance.
    Note To connect an ECS instance in the classic network to an RDS instance in a VPC through the internal network, you can use ClassicLink or switch the network type to VPC.

Change the expiration time for the original internal endpoint of the classic network

During the hybrid access period, you can change the retention period for the original internal endpoint of the classic network at any time as needed. The system will update the expiration date based on the modified date. For example, if the original internal endpoint of the classic network is set to expire on August 18, 2017, and you change the expiration time to "14 days later" on August 15, 2017. The internal endpoint of the classic network is released on August 29, 2017.

Follow these steps to change the expiration time:

  1. Log on to the ApsaraDB for RDS console.
  2. In the upper-left corner of the page, select the region where the instance is located.
    Select a region
  3. Find the instance and click the instance ID.
  4. In the left-side navigation pane, click Database Connections.
  5. On the Instance Connection tab, click Change Expiration Time, as shown in the following figure.

    修改过期时间
  6. On the Change Expiration Time page that appears, select an expiration time and click OK.