All Products
Search
Document Center

:How to use GTM to implement zone-disaster recovery_Global Traffic Manager (GTM) 3.0

Last Updated:Apr 22, 2025

Scenarios

Your application service is deployed in two data centers, such as Data Center A and Data Center B, and each data center uses a public IP address for ingress traffic. You hope that the application service works in the following ways: When the two data centers work properly, all traffic to the application service is routed to Data Center A. When Data Center A fails, your system can automatically detect the failure and fail over the service to Data Center B.

Prerequisites

  • The domain name cloud-example.com is hosted by Alibaba Cloud DNS. You want to connect the business domain name www.cloud-example.com to Global Traffic Manager (GTM).

    Note

    If your business domain name is not hosted by Alibaba Cloud DNS, you can also use GTM. You need to add a canonical name (CNAME) record to DNS settings of the current DNS service provider of the business domain name to map the business domain name to the corresponding access domain name in GTM.

  • A GTM instance, for example, gtm-cn-7213ohb**03, is purchased. To purchase an instance, see Purchase an instance.

  • The following traffic scheduling is required.

    Source of DNS requests

    IP address of application service

    IP address after failover

    Global default

    1.1.XX.XX

    2.2.XX.XX

Procedure

  1. Log on to the Alibaba Cloud DNS console.

  2. In the left-side navigation pane, click Global Traffic Manager to go to the Global Traffic Manager3.0 page.

  3. On the Access Domain Name tab, click Create Access Domain Name.

  4. In the Select Scenario dialog box, select Primary/Secondary Disaster Recovery.

  5. On the Create Access Domain Name page, move the pointer over the Access Domain Name icon and click Basic Configuration.

  6. In the Basic Access Domain Name Configuration panel, configure the parameters and click Submit. For more information about how to configure an access domain name, see Configure an access domain name.image

  7. On the Access Domain Name page, move the pointer over the Address Pool icon and click Basic Configuration. For more information, see Basic configuration parameters in the Configure an address pool topic.

  8. On the Access Domain Name page, move the pointer over an Address icon and click Basic Configuration. In the Basic Address Configuration panel, add an address, configure one or more health check template and other parameters, and then click Submit. In this example, tcp is selected for the Detection Protocol parameter and port 80 is selected for the Port Number parameter of health checks. Repeat this step to add addresses and associate them with health check templates.

    Note

    If no health check template is created, click Quickly Add Detection Template to create one. For more information, see Health check templates.

    image

    Important

    This example demonstrates the configuration procedure. If red or orange alert items appear in the actual configuration, check the address health status at the earliest opportunity.

  9. Usually, you do not need to configure load balancing policies because the scenario-specific template automatically generates policies.

    Important

    If application data is synchronized between the primary and secondary IP addresses in one-way mode, the data generated at the secondary site during the period when the secondary site takes over services due to failures of the primary site cannot be synchronized to the primary site. We recommend that you set the Load Balancing Policy for Addresses parameter to Order and the Prior Resource Recovery Mode parameter to Non-preemptible Mode. For more information, see Parameters for configuring the policies of load balancing between addresses in the Configure an address pool topic.

  10. Configure alert settings for the instance. For more information, see Configure alert settings.

  11. On the Access Domain Name page, move the pointer over the Access Domain Name icon and click Enable.image

  12. In the Confirm Access Domain Name Enabling dialog box, confirm that the configuration of the access domain name is correct and click OK.

    Important
    • If a domain name record with the same name and the same type exists in the Authoritative DNS Resolution module of Alibaba Cloud DNS, the system first intelligently schedules and resolves DNS requests for this domain name based on the policy configured in GTM to implement advanced features such as traffic load balancing and failovers.

    • If you disable or delete this access domain name in GTM, requests for this domain name will be resolved by the Authoritative DNS Resolution module of Alibaba Cloud DNS.