ApsaraDB RDS for MySQL lets you migrate proxy nodes to another zone. We recommend that your proxy nodes and primary RDS instance are in the same zone.
If you have questions or want to learn more about the database proxy feature, join our DingTalk user group (ID: 106730000316) for support and feedback.
Prerequisites
-
The RDS instance must meet the following requirements:
-
Engine: ApsaraDB RDS for MySQL
-
Edition: RDS High-availability Edition or RDS Cluster Edition
-
Storage type: cloud disk
-
The database proxy feature must be enabled.
-
Instance status: Running
NoteThe primary RDS instance, read-only RDS instances, and proxy nodes must all be running.
-
-
You cannot migrate proxy nodes that use a classic network endpoint. For more information, see View and manage instance endpoints and ports.
Billing
You can migrate proxy nodes across zones free of charge.
Impacts
-
Migrating proxy nodes causes a transient disconnection that lasts for about 30 seconds.
-
For RDS High-availability Edition instances, the migration does not affect workloads that use the endpoint of the primary RDS instance or a read-only RDS instance.
-
For RDS Cluster Edition instances, the migration does not affect workloads that use the read/write endpoint, read-only cluster endpoint, or a node's direct connection endpoint.
NoteWe recommend that you switch your application to use one of the unaffected endpoints and perform the migration during off-peak hours.
-
-
Ensure that your application has an automatic reconnection mechanism.
NoteIf your application does not have an automatic reconnection mechanism, you must manually reconnect the application to the database.
-
A cross-zone migration changes the virtual IP address (VIP) of the endpoint. We recommend that you always use the endpoint string in your application to connect, rather than a hardcoded IP address.
-
Clear the DNS cache on the client side immediately after the migration. If your application runs on a Java Virtual Machine (JVM), we recommend setting the time-to-live (TTL) in the JVM configuration to 60 seconds or less. This ensures that your application can use DNS to resolve the new VIP after the address changes.
NoteFor information about how to set the TTL in the JVM configuration, see the official JDK documentation: Class InetAddress.
-
The migration may fail if the destination zone has insufficient resources.
-
Cross-zone migration may invalidate the nearest access feature.
After the migration, nearest access routes traffic to the new zone by default, and nearest access for the original zone becomes invalid. If you modify the target zone of a proxy endpoint to be different from its default zone, nearest access for that corresponding zone becomes invalid. The following table describes example scenarios.
Scenario
Original proxy information
Destination proxy information
Current proxy zone
Proxy endpoint
Nearest access
Destination proxy zone
Default endpoint zone
Destination endpoint zone
Nearest access
Scenario 1:
Zone A + Zone BtoZone A + Zone CZone A
Proxy endpoint a
Zone A
Zone A
Zone A
Zone A
Zone A
Zone C
Invalid
Zone B
Proxy endpoint b
Zone B
Zone C
Zone C
Zone C
Zone C
Zone D
Invalid
Scenario 2:
Zone A + Zone BtoZone C + Zone DZone A
Proxy endpoint a
Zone A
Zone C
Zone C
Zone C
Zone C
Zone E
Invalid
Zone B
Proxy endpoint b
Zone B
Zone D
Zone D
Zone D
Zone D
Zone E
Invalid
If the proxy nodes and the primary RDS instance are in different zones, write performance may decrease when you connect through the database proxy. We recommend that the proxy nodes and the primary RDS instance use the same VPC and vSwitch.
Procedure
-
Go to the RDS instances page, select the region of your RDS instance in the top navigation bar, and then click the instance ID.
-
In the left-side navigation pane, click Database Proxy. The basic information about your proxy nodes is displayed.
-
Click Cross-zone Migration.
NoteIf the Cross-zone Migration button is not displayed, check whether your instance meets the prerequisites.
-
In the Cross-zone Migration of Database Proxy dialog box, select a destination zone and vSwitch for the migration, specify a time for the change, and then click OK.
ImportantDuring the cross-zone migration, you cannot change the proxy node type or instance specifications.
-
Carefully read the migration impacts, and then click OK.
API reference
|
API |
Description |
|
Migrates proxy nodes to a destination zone by specifying the VSwitchIds parameter. |
FAQ
-
Q: Does migrating proxy nodes across zones affect connections to my primary RDS instance?
A: No, the migration only affects application connections that use a database proxy endpoint. This migration does not affect connections that use the endpoint of the primary RDS instance, a read-only RDS instance, the read/write endpoint, the read-only cluster endpoint, or a node's direct connection endpoint. We recommend switching your application to one of the unaffected endpoints and performing the migration during off-peak hours.
-
Q: What are the impacts of migrating proxy nodes across zones?
A: Migrating proxy nodes causes a transient disconnection that lasts for about 30 seconds. The actual duration of the interruption depends on your workload. We recommend switching to an unaffected endpoint and performing the migration during off-peak hours. For more details, see the Impacts section in this topic.