This topic describes how to switch the primary zone in the ApsaraDB for OceanBase console.
Concepts
In ApsaraDB for OceanBase, the data replicas of the same partition are distributed to multiple zones. The zone where the leader of partitions resides is called the primary zone.
Scenarios
When the primary zone fails, ApsaraDB for OceanBase will automatically switch the leader to a new zone to ensure service availability.
If you want to perform a drill for the high availability feature, you can manually switch the primary zone in the ApsaraDB for OceanBase console. Generally, we recommend that you do not manually switch the primary zone.
Considerations
To ensure the primary zone access performance, make sure that the primary zone and the primary address proxy are in the same zone after the drill.
Procedure
Log on to the ApsaraDB for OceanBase console.
In the left-side navigation pane, click Instances.
In the instance list, click the name of the target instance to go to the instance workspace.
For a serverless instance, click Switch Primary Zone in the Deployment Diagram section. For a cluster instance, go to the Tenant Management page and click the target tenant in the tenant list to go to the Tenant Workspace page. Then, click the More icon in the upper-right corner and select Switch Primary Zone.
If you switch the zone where the primary address proxy resides, services will be interrupted for about 30s during the switching process. We recommend that you perform the operation in off-peak hours. Automatic reconnection is supported for business applications.
If you switch the zone where the primary address proxy resides, the virtual IP address will be changed. Therefore, use a connection address for your application instead of an IP address.
The database becomes temporarily unavailable due to the change of the virtual IP address. Refresh and obtain the updated connection information in the ApsaraDB for OceanBase console.
The change of the virtual IP address also affects the use of tools such as OceanBase Developer Center (ODC) and OceanBase Migration Service (OMS). Make sure that the latest virtual IP address is used for the connection of the tools.
Your other Alibaba Cloud services that use the OceanBase cluster may become unavailable after the switchover. You can submit a ticket for assessment.
In the dialog box that appears, set the related parameters.
Parameter
Description
Primary Zone
Select one or more zones.
NoteYou cannot select the zone where a read-only address exists as the data primary zone.
If the cluster uses the single-IDC deployment solution, you cannot switch the primary zone for tenants in the cluster instance.
If the cluster uses the dual-IDC deployment solution, you can switch the primary zone for tenants in the cluster instance. If a read-only address exists in the other zone, you cannot switch the primary zone.
Zone for Primary Address Proxy
Select the new zone for the primary address proxy. You cannot select a zone with a read-only address.
NoteIf the zone for the primary address proxy and the data primary zone are different, data latency exists.
When a direct connection address is used, selecting multiple zones can increase the access latency of the direct connection address. We recommend that you use a primary address or access address instead of a direct connection address.
VPC ID
Select the VPC.
NoteIf you modify the VPC or vSwitch of a connection address, services will be interrupted for about 30s during the switching process. We recommend that you perform the operation in off-peak hours and ensure that the application supports reconnection.
Access vSwitch through primary address
Select the vSwitch to bind.
Click OK.