Create a GTM instance that distributes traffic across two addresses with health checks for automatic failover.
Tutorial overview
|
Step |
Description |
Quick links |
|
Authorize access to cloud resources |
First-time GTM use requires a service-linked role authorization. Once authorized, GTM can access CloudMonitor alert notification groups. Note
This authorization is required only once per account. Skip this step if already authorized. |
|
|
Create an instance |
Create a GTM instance for your application service. Standard and Ultimate editions are available. |
|
|
Create an address pool |
Create an address pool to group your application's service addresses. Configure the pool type, load balancing policy, and address return mode. |
|
|
Configure an access policy |
An access policy routes users to a specific address pool collection. GTM supports two types: geo-based access policy and latency-based access policy. Use the geo-based access policy to return addresses by ISP or region. Use the latency-based access policy to route users to the lowest-latency backend. |
|
|
Set up basic configurations |
Configure basic settings for your GTM instance: business domain, CNAME access domain type, global TTL, and alert notification group. |
|
|
Enable health checks |
Enable Ping, TCP, or HTTP(S) health checks to monitor application availability in real time. |
|
|
Connect to GTM by using a CNAME record |
After configuration and testing, point your business domain to the GTM CNAME access domain to connect your application to GTM. |
Authorize access to cloud resources
First-time GTM use requires a service-linked role authorization. Once authorized, GTM can access alert notification groups in your CloudMonitor service.
This authorization is required only once per account. Skip this step if already authorized.
On the Cloud Resource Access Authorization page, verify the service-linked role AliyunServiceRoleForGTM with policy AliyunServiceRolePolicyForGTM, then click Confirm Authorization.
Create an instance
Purchase a GTM instance before proceeding.
Multiple business domains that resolve to the same addresses can share one GTM CNAME access domain. Otherwise, each domain requires a separate instance.
-
Go to the Alibaba Cloud DNS - Global Traffic Manager console.
-
Click Create Instance to open the product purchase page.
-
Select an edition based on your requirements, click Buy Now, and complete the payment.
-
After purchase, an instance is created automatically. The instance list shows the instance ID (for example,
gtm-cn-wwo3xxx), CNAME access domain, health check task quota, alert notification count, status (Normal), plan version, and expiration date. In the Operation column, click Configure, Upgrade, or Renew to manage the instance.
Create an address pool
An address pool groups IP addresses or domain names that provide the same application service.
-
Go to the Alibaba Cloud DNS - Global Traffic Manager console.
-
In the instance list, find the instance that you want to manage and click Configure in the Operation column.
-
Select the Address Pool Configuration tab, and then click Add Address Pool. After you configure the parameters, click Confirm.
In the Add Address Pool dialog box, set Address Pool Name (for example, testPool), Address Pool Type (for example, IPv4), and Load Balancing Policy (Address) (for example, Return All Addresses). In Address List, add an address (for example, 1.1.XX.XX) and select the Mode (for example, smart return). Add more addresses with Add Row or Batch Add.
Configure an access policy
-
The latency-based access policy is available only for the Ultimate edition.
-
If you enable the latency-based access policy, GTM ignores the load balancing policy configured in the address pool.
-
You can enable only one type of access policy for an instance.
Prerequisites
-
You have created an instance and authorized access to cloud resources.
-
At least two public IP addresses are available for your application service. These can be from Alibaba Cloud services (such as SLB or ECS) or any other public source. Alibaba Cloud service IPs are recommended.
Procedure
Basic configuration
Configure the global settings for your GTM instance: Instance Name, CNAME Access Domain Type, Business Domain, Global TTL, and Alert Notification Group.
Prerequisites
You have created an instance, authorized access to cloud resources, and configured an access policy.
Procedure
Enable health checks
Prerequisites
You have created an instance and created an address pool.
Procedure
Connect to GTM by using a CNAME record
If your domain uses Alibaba Cloud DNS, configure a CNAME record in the Alibaba Cloud DNS console.
Prerequisites
You have authorized access to cloud resources, created an instance, configured an access policy, and set up basic configurations.