Scenarios
Enterprises engaging in the industries of websites, games, videos, and live streaming can integrate application services with Alibaba Cloud CDN to accelerate access to origin server content. These enterprises usually require high business availability. However, Alibaba Cloud CDN cannot detect the running status of the origin IP addresses, which makes it impossible to switch access traffic from abnormal addresses to normal addresses. In this case, Global Traffic Manager (GTM) can be used to help enterprises achieve load balancing, fault detection, and automatic failover.
Solutions
Both Alibaba Cloud CDN and GTM use canonical names (CNAMEs) to provide corresponding services. If you point the same subdomain name to different CNAMEs, one of the services is unavailable because authoritative Domain Name System (DNS) servers respond to the DNS requests in the round-robin mode. However, the business scenarios of many enterprises require both domain name acceleration and high availability of origin servers. Therefore, we recommend that you integrate Alibaba Cloud CDN with GTM to meet such requirements.
Procedure
Main steps
Configure a GTM instance.
Add your domain name in the Alibaba Cloud CDN console.
Prepare resources
Prepare a test domain name, such as test.alidns.com.
Create a GTM instance.
Activate Alibaba Cloud CDN.
Step 1: Configure a GTM instance
Create two address pools and enable the health check feature for the address pools
Log on to the Alibaba Cloud DNS console, and click Global Traffic Manager in the left-side navigation pane. Find the desired GTM instance and click Settings in the Actions column.
On the Basic Settings page, click the Address Pools tab, and click Create Address Pool. Create two address pools that are described in the following table.
Address pool name
IP address
Mode
test1
1.1.XX.XX
Intelligently returned
test2
2.2.XX.XX
Intelligently returned
On the Address Pools page, click the + icon before the address pool and click Add after Health Check. Configure the health check feature.
Configure an access policy
On the Basic Settings page, click Settings in Geographical Location-based Access Policy of the Access Policy Type section.
Click Create Access Policy and configure the access policy.
Policy name
Primary address pool set
Standby address pool set
DNS request source
Global
test1
test2
Global
Modify the basic settings of the GTM instance
On the Basic Settings page, click Modify. In the panel that appears, specify the following parameters: Instance Name, CNAME(Internet), Business Domain Name(Internet), Global TTL Period, Alert Group, and Notification Methods.
Step 2: Add the domain name in the Alibaba Cloud CDN console
On the Basic Settings page, copy the CNAME of the GTM instance.
Log on to the Alibaba Cloud CDN console. In the left-side navigation pane, click Domain Names. On the Domain Names page, click Add Domain Name. Configure the following parameters based on your business requirements: Region, Domain Name to Accelerate, Business Type, and Origin Servers.
NoteSelect Site Domain for the Origin Info parameter and specify the copied CNAME as the domain name.
After you add the domain name, the domain name is in the reviewing state and then in the configuring state. Wait a few minutes until the domain name is in the enabled state. Then, go to the Alibaba Cloud DNS console and add a CNAME record for the domain name. Point the service domain name test.alidns.com to the domain name added in the Alibaba Cloud CDN console.
After you add the CNAME record, go to the Domain Names page in the Alibaba Cloud CDN console. If Configuration Completed is displayed in the CNAME Status column of the desired domain name, the domain name is integrated with Alibaba Cloud CDN.