PolarDB for MySQL Enterprise Edition allows you to switch the Virtual Private Cloud (VPC) and vSwitch online in the original zone. The endpoint of the PolarDB for MySQL cluster remains unchanged. This topic describes how to switch the VPC and vSwitch.
Precautions
This feature is applicable only to Enterprise Edition clusters of PolarDB for MySQL Enterprise Edition.
When you switch the VPC and vSwitch, a transient connection that lasts approximately 30 seconds occurs. We recommend that you perform this operation during off-peak hours and ensure that your application supports automatic reconnection.
After you switch the VPC and vSwitch, the old information may remain in the Domain Name System (DNS) cache before the cache expires. During this time, you may fail to connect to the database. To resolve the issue, we recommend that you restart the applications or refresh the DNS cache of the host on which the applications are deployed.
This operation interrupts the connection between your cluster and Data Management (DMS) or the connection between your cluster and Data Transmission Service (DTS) for a short period of time. After your cluster is connected to the new VPC and vSwitch, the connection is automatically resumed.
Change the default VPC and default vSwitch
Log on to the PolarDB console. In the upper-left corner, select a region and click the ID of the cluster.
On the Basic Information page, click Switch next to Default VPC.
In the Switch VPC dialog box, select a VPC and a vSwitch from the drop-down list.
Set Existing Endpoint Switching and click OK.
If you select No for Existing Endpoint Switching, only the default VPC and default vSwitch of the cluster are changed. The default VPC and default vSwitch are automatically selected the next time you create a custom endpoint.
If you select Yes for Existing Endpoint Switching, the default VPC and default vSwitch of the cluster are changed. The VPCs and vSwitches of all endpoints are also changed.
Change multiple VPCs and vSwitches at a time
Log on to the PolarDB console. In the upper-left corner, select a region and click the ID of the cluster.
On the Basic Information page, click Switch next to Default VPC.
In the Switch VPC dialog box, select a VPC and a vSwitch from the drop-down list.
Select Yes for Existing Endpoint Switching and click OK.
Modify the VPC and vSwitch of a single endpoint
Log on to the PolarDB console. In the upper-left corner, select a region and click the ID of the cluster.
In the Dedicated Enterprise Edition or Standard Enterprise Edition section, click Modify Settings next to the primary endpoint.
In the Modify Endpoint Settings dialog box, choose More > Edit.
In the Modify Private Endpoint dialog box, select the VPC and vSwitch from the drop-down list, and then click OK.
Then, the default VPC and default vSwitch of the cluster are the same as the VPC and vSwitch of the primary endpoint.
Specify the VPC and vSwitch when you create a custom endpoint
Log on to the PolarDB console. In the upper-left corner, select a region and click the ID of the cluster.
In the Dedicated Enterprise Edition or Standard Enterprise Edition section, click Create Custom Cluster Endpoint.
In the Create Custom Cluster Endpoint dialog box, select a VPC and a vSwitch from the drop-down list.
Configure other settings and click OK.
When you create a custom endpoint, the default VPC and default vSwitch are selected for the cluster by default. If the default VPC and default vSwitch are not selected for the cluster, the default VPC and default vSwitch of the cluster are changed after the custom endpoint is created.