If your application runs in two data centers, each with a public IP address, you can use Global Traffic Manager (GTM) to route all traffic to the primary data center and automatically fail over to the standby when the primary becomes unavailable.
Prerequisites
Your domain
cloud-example.comis hosted on Alibaba Cloud DNS. The subdomain managed by GTM iswww.cloud-example.com.NoteIf your domain uses a third-party DNS provider, add a CNAME record pointing to the GTM access zone name in that provider's console.
A GTM instance is available. If not, purchase a subscription instance.
Target traffic scheduling result:
| Source of DNS queries | Primary endpoint | Failover endpoint |
| Global default | 1.1.XX.XX | 2.2.XX.XX |
Procedure
Go to the Alibaba Cloud DNS - Global Traffic Manager console.
On the Access Domain tab, click Create Access Domain.
In the Select Scenario dialog box, select Primary/Secondary Disaster Recovery.
On the Create Access Domain page, click the access zone name icon and select Basic Configuration.
On the Basic Configuration page, set the required parameters and click Submit. For details, see Configure an access zone name.
On the current page, click the address pool icon and select Basic Configuration.

On the Access Domain page, click the address icon and select Basic Configuration. Add the endpoint IP address, configure a health check template (for this example, TCP protocol, port 80), and create the address. Repeat for all required addresses.
NoteIf no health check template exists, click Add Health Check Template. For details, see Health check templates.
ImportantIf you encounter red or orange alerts during setup, check the health status of your addresses.
The scenario template generates a load balancing policy. Manual configuration is typically not needed.
ImportantWith one-way data synchronization (from primary to standby), data generated on the standby during a failover cannot be returned to the primary. To prevent data loss upon recovery, set the address pool's load balancing policy to Non-Preemptive Mode. For details, see Configure an address pool.
Configure alert rules for the instance. For details, see Configure alerts.
On the Access Domain page, click the access zone name icon and select Enable.
In the confirmation dialog box, verify the details and click OK to enable the Access Domain.
ImportantIf a DNS record with the same name and type already exists in Alibaba Cloud DNS, GTM policies take precedence over standard domain name resolution for that domain.
If the GTM instance is disabled or deleted, DNS queries fall back to Alibaba Cloud DNS Public Zone records.