This topic describes how to change the primary zone of a three-zone PolarDB-X instance. This topic also describes how to resolve the issue that some leader nodes are not deployed in the primary zone of the instance.
Create a three-zone instance
When you purchase a PolarDB-X instance, you can set the Topology parameter to Three-zone or Single-zone. To create a three-zone instance, set the Topology parameter to Three-zone. For more information, see Create a PolarDB-X instance.
View information about a three-zone instance
After a three-zone instance is purchased, you can view the information about the zones on the related pages of the instance.
Instance list
On the Instances page, the primary zone and secondary zone are displayed for the three-zone instances.
Instance basic information
The Basic Information page of a three-zone instance also displays the primary zone and secondary zone of the instance.
Instance topology
On the Basic Information page of a three-zone instance, you can view the zone in which each node resides and the status of each node in the Topology Information section.
Specify the primary zone for an instance
Log on to the PolarDB for Xscale console.
In the top navigation bar, select the region where the target instance is located.
On the Instances page, click the PolarDB-X 2.0 tab.
Find the target instance and click its ID.
In the left-side navigation pane, click Basic Information. In the Topology Information section, click Specify Primary Zone.
In the Specify Primary Zone dialog box, select the ID of the zone that you want to specify as the primary zone of the instance and click OK.
ImportantPrimary zone change operations cause transient connections. We recommend that you change the primary zone during off-peak hours.
After you change the primary zone of the instance, the status of the instance changes to Under HA Switchover. After the status of the instance becomes Running, the primary zone of the instance is changed to the specified zone.
FAQ
Some compute nodes in a three-zone instance are in the Inactive state and assume the standby role. What are the purposes of these compute nodes in the three-zone instance?
In a three-zone instance, the master compute nodes in the primary zone handle the read and write tasks of the database and maintain the most up-to-date state of the data. Standby compute nodes in the secondary zone serve backups, ready to quickly take over the workload of the master nodes in the event of a failure of the primary zone. Go to the Basic Information page of the instance. In the Topology Information section, click Specify Primary Zone. In the Specify Primary Zone dialog box, select the ID of the primary zone of the instance and click OK. The role of the compute nodes in the original secondary zone changes from standby to master.
What do I do if some leader data nodes are not deployed in the primary zone of the instance?
Go to the Basic Information page of the instance. In the Topology Information section, click Specify Primary Zone. In the Primary Zone drop-down list, select the ID of the primary zone of the instance and click OK. The status of the instance changes to Under HA Switchover for a short period of time. After the status of the instance changes to Running, all leader data nodes and metadata services are in the primary zone of the instance.
ImportantPrimary zone change operations cause transient connections. We recommend that you change the primary zone during off-peak hours.