All Products
Search
Document Center

ApsaraDB RDS:Migrate database proxies across zones

Last Updated:Jul 01, 2024

ApsaraDB RDS for MySQL supports cross-zone migration of database proxies. You can migrate the database proxies of an ApsaraDB RDS for MySQL instance across zones in the same region. We recommend that you migrate the database proxies to the zone of the primary RDS instance.

Prerequisites

  • Your RDS instance meets the following requirements:

    • The RDS instance runs MySQL.

    • The RDS instance runs RDS High-availability Edition or RDS Cluster Edition.

    • The RDS instance uses cloud disks.

    • The database proxy feature is enabled for the RDS instance.

    • The RDS instance is in the Running state.

      Note

      Make sure that the primary RDS instance, its read-only RDS instances, and its database proxy instance are all in the Running state.

  • The RDS instance uses endpoints of the virtual private cloud (VPC) network type. Cross-zone migration is not supported for database proxies if the database proxy instance is of the classic network type. For more information, see View and manage instance endpoints and ports.

Billing rules

You can migrate database proxies across zones free of charge.

Impacts

  • When you migrate database proxies across zones, a transient connection that lasts for approximately 30 seconds occurs during the migration.

    • If your RDS instance runs RDS High-availability Edition, you can use the endpoint of the primary RDS instance or a read-only RDS instance to connect your application to the RDS instance. This helps prevent your workloads from being unaffected.

    • If your RDS instance runs RDS Cluster Edition, you can use the read/write endpoint, read-only endpoint, or direct node connection endpoint to connect your application to the RDS instance. This helps prevent your workloads from being unaffected.

    Note

    We recommend that you connect your application to the RDS instance by using the preceding endpoints and migrate database proxies across zones during off-peak hours.

  • Make sure that your application is configured to automatically reconnect to your RDS instance.

    Note

    If your application is not configured to automatically reconnect to your RDS instance, manually reconnect your application to your RDS instance.

  • The cross-zone migration causes changes to the virtual IP addresses (VIPs) of your RDS instance. We recommend that you use an endpoint rather than an IP address of your RDS instance to connect your application to your RDS instance.

  • After the cross-zone migration, you must immediately delete the cached DNS records from the database client. If the database client runs on a Java virtual machine (JVM), we recommend that you set the time-to-live (TTL) in the JVM configuration to 60 seconds or less. This way, if the VIP that is bound to the in-use endpoint of your RDS instance changes, your application can query the related DNS records again to obtain the new VIP. Then, your application can connect to the new VIP.

    Note

    For more information about how to specify the TTL in the JVM configuration, see Class InetAddress.

  • If the resource inventory in the zone to which you want to migrate database proxies is insufficient, the migration may fail.

Important

If your primary RDS instance and database proxy instance are in different zones, the write performance decreases when you use a database proxy endpoint to connect to the RDS instance. We recommend that you specify the same VPC and vSwitch for the internal endpoint of the database proxy instance and the primary RDS instance.

Procedure

  1. Log on to the ApsaraDB RDS console and go to the Instances page. In the top navigation bar, select the region in which your RDS instance resides. Then, find the RDS instance and click the instance ID.

  2. In the left-side navigation pane, click Database Proxy and view the basic information about your database proxy instance.

  3. Click Cross-zone Migration.

    Note

    If Cross-zone Migration is not displayed, you must check whether your RDS instance meets the prerequisites.

    image

  4. In the Cross-zone Migration of Database Proxy dialog box, view the zone and network information about the primary RDS instance and database proxy instance. Select a destination zone, a destination vSwitch, and the migration time. Then, click OK.

    Note

    You can also click Modify Configuration to change the type and specifications of the database proxy instance.

    image

Related operations

Operation

Description

ModifyDBProxyInstance

Migrates database proxies to a destination zone by specifying vSwitchIds.

FAQ

  • Does the cross-zone migration of database proxies affect the connection to my primary RDS instance?

    The cross-zone migration of database proxies affects your workloads only if you use a database proxy endpoint to connect to your RDS instance. If your RDS instance runs RDS High-availability Edition and you use the endpoint of the primary RDS instance or a read-only RDS instance to connect your application to the RDS instance, your workloads remain unaffected. If your RDS instance runs RDS Cluster Edition and you use the read/write endpoint, read-only endpoint, or direct node connection endpoint to connect your application to the RDS instance, your workloads remain unaffected. We recommend that you connect your application to the RDS instance by using the preceding endpoints and migrate database proxies across zones during off-peak hours.

  • What are the impacts of the cross-zone migration of database proxies?

    When you migrate database proxies across zones, a transient connection that lasts for approximately 30 seconds occurs during the migration. The duration of the interruption varies based on your business. We recommend that you use the endpoints that are not affected by the migration to connect to your RDS instance and migrate database proxies across zones during off-peak hours. For more information, see Impacts.