tencent cloud

Feedback

Switching AZs

Last updated: 2024-04-25 14:50:14
    The TDSQL-C MySQL version supports the switching of the primary and secondary availability zones within a cluster. This means that in the event of a cluster failure, the secondary database can be switched to the primary database to ensure system availability and data integrity. This document will guide you through the process of switching availability zones via the console.

    Use Cases

    The availability zone switching feature is applicable in scenarios such as disaster recovery and equipment failure.
    

    Notes

    The connection will be disconnected for about 2 to 5 seconds during the primary/secondary AZ switch. We recommend that you switch during off-peak hours and that your application has a reconnection mechanism.
    The data does not need to be migrated if the target AZ is a secondary AZ. The system simply needs to switch the database compute nodes, allowing for a rapid cross-data center switch. This is often used in disaster recovery drills.
    The cluster undergoes a comprehensive primary-secondary switch, meaning that all nodes within the cluster, including both read-write and read-only nodes, are switched (partial node switching is not supported).
    The read-write and read-only addresses will not be changed after the switch.

    Directions

    Automatic switch

    This feature supports automatic switching between the primary and secondary AZs in case of failure, ensuring your business can continue to operate and your database is protected. In addition, you can follow the steps below to manually switch AZs.

    Manual switch

    If your business requires an immediate switch of the primary and secondary AZs for the cluster or a switch at a designated time, you can perform a manual AZ switching operation. On the cluster list page, perform the operation according to the actual view mode:
    Tab View
    List view
    1. Log in to the TDSQL-C for MySQL console, locate the cluster list on the left, and click Target Cluster to enter the cluster management page.
    2. On the Cluster Management page, between the primary and secondary AZs in the architecture diagram under the cluster details, click
    
    to switch the primary and secondary AZs.
    
    3. In the pop-up dialog box, select Switch immediately or Switch during maintenance time , and check Switching AZs will cause a momentary disconnection. Ensure that your business has the reconnection mechanism, and click Confirm .
    Note:
    Switching AZs will cause a momentary disconnection. Ensure that your business has the reconnection mechanism.
    Select the Instance List page, click the corresponding Instance ID to enter the instance details page, and click edit behind Maintenance Information to set or modify the maintenance time.
    
    4. When the cluster status is Running , you can peek at the switched AZ in the architecture diagram under Cluster Details .
    1. Log in to the TDSQL-C for MySQL console, locate the cluster list, and click a cluster ID or Operation column's Management to enter the cluster details page.
    2. In the Availability Information module on the cluster details page, click Switch AZs .
    
    3. In the pop-up dialog box, select Switch immediately or Switch during maintenance time , check "Switching AZs will cause a momentary disconnection. Ensure that your business has the reconnection mechanism", and click Confirm .
    Note:
    Switching AZs will cause a momentary disconnection. Ensure that your business has the reconnection mechanism.
    Select the Instance List page, click the corresponding Instance ID to enter the instance details page, and click edit behind Maintenance Information to set or modify the maintenance time.
    
    4. When the cluster status is Running , you can check at the switched AZ in the Availability Information section on the Cluster Details page .

    FAQs

    How long does it take to complete an AZ switch?

    If the target AZ is a secondary AZ, the data does not need to be migrated when the primary AZ changes. The system simply needs to switch the database compute nodes, allowing for a rapid cross-data center switch.

    Will the read-write address be changed after the entire cluster is switched?

    When the entire cluster undergoes a switch, all the read-write nodes and read-only nodes within the cluster are switched, but the read-write addresses and read-only addresses will not change.

    After manual/automatic switch, if an instance is upgraded, will the upgrade affect or reset the information of the primary and secondary AZs?

    Switching does not affect or reset the information of the primary and secondary AZs.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support