Azure Traffic Manager- provide global accessibility to the site or service

No public attention for more Microsoft cloud Azure AIOT + Cloud combat video:

 

Load balancing products on the Azure addition to Layer 4 load balancing previously introduced (see "  High Availability (1) on Azure - load balancing "), as well as a cross-product area, which is Azure Traffic Manager, and layer 4 load balancing, the biggest difference between Azure Traffic Manager provides load balancing across the region.

 

Azure Traffic Manager is a DNS-based load balancer flow, it can be the best way to distribute traffic to services on a global Azure region, while providing high availability and responsiveness.

Traffic Manager Traffic routing methods according to operating conditions and endpoints using DNS client requests directed to the most appropriate service endpoint. Endpoints can be hosted in Azure inside or outside of any Internet service-oriented. Traffic Manager offers a variety of traffic routing methods and endpoint monitoring options to meet different application requirements and automatic failover model. Traffic Manager can respond flexibly failures, including failure of the entire Azure region.

Azure Traffic Manager Basics Video description:

 https://v.qq.com/x/page/e3040r6u0dx.html

Traffic Manager offers six routing method, comprising:

1. Priority (Priority):

A list of priority traffic manager configuration file contains the service endpoint. By default, the traffic manager to send all traffic to the primary endpoint (highest priority). If the primary endpoint is unavailable, traffic managers will route traffic to the second endpoint. If the primary endpoint and secondary endpoints are not available, the flow goes to the end of the third point, and so on. Availability status depends on the configuration of the endpoint (enabled or disabled) and ongoing endpoint monitoring.

Each endpoint may be used "priority" attribute explicitly configure an endpoint priority. This attribute is a value between 1 and 1000 nm. The smaller the value, the higher the priority. Endpoints can not be shared priority value. Setting this property is optional. If this attribute is omitted, the default will be used in accordance with the priority order of the endpoint.

2. weight (Weighted):

        In the "weighting" method of routing traffic, the weighting is an integer of from 1 to 1000. This parameter is optional. If you omit this parameter, Traffic Manager uses the default weight "1." The higher the weight, the higher the priority.

For each received DNS query traffic management will randomly select one of the available endpoints. Right choice depends on which endpoints available from the endpoint assigned to all heavy. Use the same rights to all endpoints can cause weight evenly distributed flow.

Some useful methods may be implemented weighting scheme:

Applications escalation: the percentage of traffic to be routed to assign a new endpoint, and over time will gradually flow to 100%.

Migrating applications to Azure: Azure create a configuration file that contains the endpoints and external endpoints. The right to adjust the endpoint by weight, preferably choose a new endpoint.

It applies to more capacity Cloudbursting: After the configuration file, to quickly expand local deployment to the cloud by deploying on local traffic manager. 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.

Must know their client to resolve DNS recursive name server will cache DNS DNS response. This cache may affect the flow-weighted distribution. If the number of clients and recursive DNS server is large, flow distribution works as expected. However, if the number of clients or recursive DNS server is small, the cache may severely affect the flow distribution.

 

3. Performance (Performance):

Deployed in two or more countries or regions endpoint location, route traffic to the "closest" your position, you can improve the response capacity of many applications. "Performance" traffic routing method to provide this capability.

"Closest" endpoint is not necessarily geographically closest endpoint. "Performance" traffic routing method to determine the end point closest to pass the test network latency. Internet Traffic Manager maintains a delay table for tracking the round-trip time between the IP address range for each Azure data center.

Traffic Manager table lookup incoming DNS request source IP address in the Internet delay. Then, the traffic management has in processing the request of the IP address range to select an available endpoint, and the endpoint returns the DNS response Azure lowest latency within the data center.

流量管理器定期更新 Internet 延迟表,反映全国 Internet 的变化以及新的 Azure 区域。 但是,由于Internet 上的负载会实时变化,应用程序性能也会随之变化。 “性能”流量路由不会监视给定服务终结点上的负载。 但是,如果某个终结点变得不可用,则流量管理器不会在DNS 查询响应中包括该终结点。

 

4.地理(Geographic ):

流量管理器配置文件可以配置为使用“地理”路由方法,以便根据用户的DNS 查询所源自的地理位置将用户定向到特定终结点(“Azure”、“外部”或“嵌套”)。 这使流量管理器客户可以启用这样的方案:在这些方案中,了解用户的地理区域,并基于该地理区域路由用户很重要。 示例包括遵守数据所有权要求、内容本地化和用户体验,以及测量来自不同区域的流量。 为地理路由分配配置文件时,与该配置文件关联的每个终结点都需要有一组分配给它的地理区域。 地理区域的粒度可以是以下级别:

世界 - 任何区域

区域分组 - 例如,非洲、中东、澳大利亚/太平洋等。

国家/地区 - 例如,爱尔兰、秘鲁、中国香港特别行政区等。

省/自治区/直辖市 - 例如,美国加利福尼亚州、澳大利亚昆士兰州、加拿大阿尔伯达省等(注意:只有澳大利亚、加拿大和美国中的省/自治区/直辖市才支持此粒度级别)。

将一个或一组区域分配到某个终结点后,来自这些区域的任何请求仅路由到该终结点。 流量管理器使用DNS 查询的源 IP 地址来确定用户从中进行查询的区域- 通常,这将是代表用户执行查询的本地DNS 解析程序的 IP 地址。

 

5.多值(Multivalue):

流量路由方法允许你在单个 DNS 查询响应中获得多个正常运行的终结点。 这使得调用方在返回的某个终结点无法响应时能够通过其他终结点进行客户端重试。 此模式可以提高服务可用性,并降低与新DNS 查询获取正常运行的终结点相关的延迟。 只有当所有终结点的类型都是“外部”并且指定为IPv4 或 IPv6 地址时,多值路由方法才有效。 当收到对此配置文件的查询时,会根据可配置的最大返回计数返回所有正常运行的终结点。

6.子网(Subnet):

流量路由方法允许你将一个最终用户IP 地址范围集映射到配置文件中的特定终结点。 此后,如果流量管理器收到针对该配置文件的DNS 查询,则它将检查该请求的源 IP 地址(大多数情况下,这是调用方使用的DNS 解析程序的传出 IP 地址),确定它映射到哪个终结点,并在查询响应中返回该终结点。

 

 

案例实战:将流量路由到离用户最近的站点

 

案例实战视频地址:

 https://v.qq.com/x/page/d3040zf64y8.html

 

 

 

实战步骤:

  1. 在中国北部和中国东部2分别创建一台虚拟机,命名为seanyuvm01和seanyuvm02;

  2. 设置两台虚拟机IP的DNS分别为:seanyuvm01.chinanorth.cloudapp.chinacloudapi.cn 和 seanyuvm02.chinaeast2.cloudapp.chinacloudapi.cn

     

     

     

  3. 虚拟机需开启3389端口,安装IIS,部署静态网站,开启防火墙80端口,此时可以通过IP访问静态网站;

     

    网站下载地址:

    https://github.com/Azure-Samples/html-docs-hello-world

    示例网站:

     

  4. 创建“性能” 流量管理器(http://seanyutest.trafficmanager.cn ),将两台虚拟机的IP添加到流量管理器终结点;

     

     

  5. 在域名5gn.link 设置域名解析,添加 web.5gn.link  CNAME 记录为流量管理器的 域名;

     

     

     

  6. 通过访问 流量管理器 seanyutest.trafficmanager.cn 和 域名 web.5gn.link 两个域名测试访问,分别从两台虚拟机(北部/ 东部2)访问,观察实际访问的网站位置。

     

     

 

关闭VM02的IIS后,会自动导流到VM01

 

 

 

扩展:下图是基于流量管理器的可负载均衡至全球的结构,请自行设置并验证。

 

 

关注公众号,全部都是Azure上的各种实战视频案例:

 

Guess you like

Origin www.cnblogs.com/shuzhenyu/p/12094777.html