Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed introduction of Azure Traffic Manager

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

The following brings you a detailed introduction of Azure Traffic Manager, hoping to give you some help in practical application. Load balancing involves a lot of things, and there are not many theories. There are many books on the Internet. Today, we will use the accumulated experience in the industry to do an answer.

In addition to the layer-4 load balancer described earlier (see "High availability on Azure (1)-load balancer"), the load balancer products on Azure also have a cross-region product, namely Azure Traffic Manager. Compared with layer-4 load balancer, the biggest difference of Azure Traffic Manager is that it provides cross-region load balancer.

Azure Traffic Manager is a DNS-based traffic load balancer that optimally distributes traffic to services within the global Azure region while providing high availability and responsiveness.

The traffic manager uses DNS to direct client requests to the most appropriate service endpoint based on the traffic routing method and the health of the endpoint. An endpoint can be any Internet-oriented service hosted inside or outside the Azure. The traffic manager provides a variety of traffic routing methods and endpoint monitoring options to meet different application requirements and automatic failover models. The traffic manager has the flexibility to respond to failures, including those of the entire Azure area.

The traffic manager provides six routing methods, including:

1. Priority (Priority):

The traffic manager profile contains a priority list of service endpoints. By default, the traffic manager sends all traffic to the primary endpoint (highest priority). If the primary endpoint is not available, the traffic manager routes the traffic to the second endpoint. If both the primary and secondary endpoints are unavailable, traffic goes to the third endpoint, and so on. The availability of endpoints depends on the status of the configuration (enabled or disabled) and endpoint monitoring in progress.

The endpoint priority can be explicitly configured using the priority property of each endpoint. This property is a value between 1 and 1000. The lower the value, the higher the priority. Endpoints cannot share priority values. The setting of this property is optional. If you omit this attribute, the default priority is used based on the endpoint order.

two。 Weighted (Weighted):

In the weighted traffic routing method, the weight is an integer from 1 to 1000. This parameter is optional. If this parameter is omitted, the traffic manager uses the default weight "1". The higher the weight, the higher the priority.

For each DNS query received, the traffic manager randomly selects an available endpoint. Which endpoint you choose depends on the weight assigned to all available endpoints. Using the same weight for all endpoints results in an even distribution of traffic.

The weighting method can implement some useful scenarios:

Application escalation: allocate the percentage of traffic to be routed to the new endpoint and gradually increase the traffic to 100% over time.

Migrate the application to Azure: create a configuration file that contains Azure endpoints and external endpoints. Adjust the weight of the endpoint and give priority to the new endpoint.

For cloud outbreaks with more capacity: quickly extend local deployments to the cloud by placing local deployments after the traffic manager profile. When you need extra capacity in the cloud, you can add or enable more endpoints and specify which part of the traffic will flow to each endpoint.

It is important to know that the client and its recursive DNS server used to resolve DNS names cache the DNS response. This cache may affect the weighted traffic distribution. If the number of clients and recursive DNS servers is large, the traffic distribution will work as expected. However, if the number of clients or recursive DNS servers is small, caching can seriously affect traffic distribution.

3. Performance (Performance):

Deploying endpoints in two or more locations in a country or region to route traffic to the location "closest" to you can improve the responsiveness of many applications. The performance traffic routing method provides this capability.

The "nearest" endpoint is not necessarily the one that is geographically closest. The performance traffic routing method determines the nearest endpoint by testing network latency. The traffic manager maintains an Internet latency table that tracks the round-trip time between the IP address range and each Azure data center.

The traffic manager looks up the source IP address of the incoming DNS request in the Internet delay table. The traffic manager then selects an available endpoint in the Azure data center with the lowest latency when processing the request for the IP address range and returns the endpoint in the DNS response.

The traffic manager regularly updates the Internet delay table to reflect changes in the national Internet and new Azure regions. However, because the load on the Internet changes in real time, application performance changes as well. Performance traffic routing does not monitor the load on a given service endpoint. However, if an endpoint becomes unavailable, the traffic manager does not include it in the DNS query response.

4. Geography (Geographic):

The traffic manager profile can be configured to use the "geographic" routing method to direct users to specific endpoints ("Azure", "external", or "nested") based on the geographic location from which the user's DNS query originates. This enables traffic manager customers to enable scenarios where it is important to understand the user's geographic area and route users based on that geographic area. Examples include compliance with data ownership requirements, content localization and user experience, and measuring traffic from different regions. When assigning a profile to a geographic route, each endpoint associated with the profile needs to have a set of geographic areas assigned to it. The granularity of a geographic area can be at the following levels:

World-any region

Regional subgroups-for example, Africa, the Middle East, Australia / Pacific, etc.

Country-for example, Ireland, Peru, Hong Kong Special Administrative region of China, etc.

Provinces / municipalities-for example, California in the United States, Queensland in Australia, Alberta in Canada, etc. (note: this level of granularity is supported only in Australia, Canada, and provinces in the United States).

After an area or group of areas is assigned to an endpoint, any requests from those areas are routed only to that endpoint. The traffic manager uses the source IP address of the DNS query to determine the area from which the user is querying-typically, this will be the IP address of the local DNS resolver that performs the query on behalf of the user.

5. Multi-valued (Multivalue):

The traffic routing approach allows you to obtain multiple functioning endpoints in a single DNS query response. This allows the caller to retry the client through other endpoints when one of the returned endpoints fails to respond. This mode improves service availability and reduces latency associated with new DNS queries getting functioning endpoints. The multi-value routing method works only if all endpoints are of type external and are specified as IPv4 or IPv6 addresses. When a query is received for this profile, all functioning endpoints are returned based on the configurable maximum return count.

6. Subnet (Subnet):

The traffic routing method allows you to map a set of end-user IP address ranges to specific endpoints in the configuration file. After that, if the traffic manager receives an DNS query for the profile, it examines the source IP address of the request (in most cases, this is the outgoing IP address of the DNS resolver used by the caller), determines which endpoint it maps to, and returns it in the query response.

Case study: routing traffic to the site closest to the user

Actual combat steps:

Create a virtual machine named seanyuvm01 and seanyuvm02 in North China and East China 2 respectively

Set the DNS of the two virtual machines IP to: seanyuvm01.chinanorth.cloudapp.chinacloudapi.cn and seanyuvm02.chinaeast2.cloudapp.chinacloudapi.cn

Virtual machine needs to open port 3389, install IIS, deploy static website and open firewall port 80. At this time, you can access static website through IP.

Set the domain name resolution in the domain name 5gn.link, and add the domain name recorded by web.5gn.link CNAME as the traffic manager

Test the access from two virtual machines (North / East 2) by accessing the traffic manager seanyutest.trafficmanager.cn and the domain name web.5gn.link, and observe the location of the actual visited website.

When the IIS of VM02 is closed, it will be automatically diverted to VM01.

Expansion: the following figure shows a global load balancing structure based on the traffic manager. Please set it up and verify it.

After reading the detailed introduction of Azure Traffic Manager above, if there is anything else you need to know, you can find out what you are interested in in the industry information or find our professional technical engineer to answer, the technical engineer has more than ten years of experience in the industry. Official website link www.yisu.com

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report