流量管理器终结点监视Traffic Manager endpoint monitoring

Azure 流量管理器包括内置的终结点监视和终结点自动故障转移功能。Azure Traffic Manager includes built-in endpoint monitoring and automatic endpoint failover. 此功能可以让你更好地交付高可用性应用程序,以便应对终结点故障(包括 Azure 区域故障)。This feature helps you deliver high-availability applications that are resilient to endpoint failure, including Azure region failures.

配置终结点监视Configure endpoint monitoring

若要配置终结点监视,必须在流量管理器配置文件中指定以下设置:To configure endpoint monitoring, you must specify the following settings on your Traffic Manager profile:

  • 协议Protocol. 选择 HTTP、HTTPS 或 TCP 作为协议,流量管理器在探测终结点以检查其运行状况时,将使用该协议。Choose HTTP, HTTPS, or TCP as the protocol that Traffic Manager uses when probing your endpoint to check its health. HTTPS 监视并不验证 SSL 证书是否有效,它只检查是否有证书。HTTPS monitoring does not verify whether your SSL certificate is valid--it only checks that the certificate is present.

  • 端口Port. 选择用于请求的端口。Choose the port used for the request.

  • 路径Path. 此配置设置仅对 HTTP 和 HTTPS 协议有效,使用这些协议时,需要指定路径。This configuration setting is valid only for the HTTP and HTTPS protocols, for which specifying the path setting is required. 为 TCP 监视协议提供此设置会导致出错。Providing this setting for the TCP monitoring protocol results in an error. 对于 HTTP 和 HTTPS 协议,指定监视功能要访问的网页或文件的相对路径和名称。For HTTP and HTTPS protocol, give the relative path and the name of the webpage or the file that the monitoring accesses. 正斜杠 (/) 是相对路径的有效条目。A forward slash (/) is a valid entry for the relative path. 此值表示文件位于根目录中(默认设置)。This value implies that the file is in the root directory (default).

  • 自定义标头设置:此配置设置用于将特定的 HTTP 标头添加到运行状况检查,以便流量管理器将该检查发送到配置文件中的终结点。Custom header settings This configuration setting helps you add specific HTTP headers to the health checks that Traffic Manager sends to endpoints under a profile. 自定义标头可以在配置文件级别指定,使之适用于该配置文件中的所有终结点,以及/或者在终结点级别指定,使之仅适用于该终结点。The custom headers can be specified at a profile level to be applicable for all endpoints in that profile and / or at an endpoint level applicable only to that endpoint. 可以使用自定义标头进行运行状况检查,通过指定主机标头,将多租户环境中的终结点正确路由到目标。You can use custom headers for having health checks to endpoints in a multi-tenant environment be routed correctly to their destination by specifying a host header. 也可使用此设置来添加唯一标头,以便标识源自流量管理器的 HTTP(S) 请求并对其进行不同的处理。You can also use this setting by adding unique headers that can be used to identify Traffic Manager originated HTTP(S) requests and processes them differently. 最多可以指定八个标头/值对(用逗号分隔)。You can specify up to eight header:value pairs seprated by a comma. 例如,“header1:value1,header2:value2”。For example, "header1:value1,header2:value2".

  • 预期的状态代码范围:可以通过此设置以 200-299、301-301 格式指定多个成功代码范围。Expected status code ranges This setting allows you to specify multiple success code ranges in the format 200-299, 301-301. 如果这些状态代码是在启动运行状况检查时作为响应从终结点接收的,则流量管理器会将这些终结点标记为正常。If these status codes are received as response from an endpoint when a health check is initiated, Traffic Manager marks those endpoints as healthy. 最多可以指定 8 个状态代码范围。You can specify a maximum of 8 status code ranges. 此设置仅适用于 HTTP 和 HTTPS 协议以及所有终结点。This setting is applicable only to HTTP and HTTPS protocol and to all endpoints. 此设置位于流量管理器配置文件级别。默认情况下,将值 200 定义为成功状态代码。This setting is at the Traffic Manager profile level and by default the value 200 is defined as the success status code.

  • 探测间隔Probing interval. 此值指定在流量管理器探测代理中检查终结点运行状况的频率。This value specifies how often an endpoint is checked for its health from a Traffic Manager probing agent. 可以在此处指定两个值:30 秒(正常探测)和 10 秒(快速探测)。You can specify two values here: 30 seconds (normal probing) and 10 seconds (fast probing). 如果未提供任何值,配置文件将设置为默认值 30 秒。If no values are provided, the profile sets to a default value of 30 seconds. 请访问流量管理器定价页,了解有关快速探测定价的详细信息。Visit the Traffic Manager Pricing page to learn more about fast probing pricing.

  • 容许的失败次数Tolerated number of failures. 此值指定在将终结点标记为不正常之前,流量管理器探测代理容许的失败次数。This value specifies how many failures a Traffic Manager probing agent tolerates before marking that endpoint as unhealthy. 其值的范围为 0 到 9。Its value can range between 0 and 9. 0 值表示发生监视失败一次就可能会导致将该终结点标记为不正常。A value of 0 means a single monitoring failure can cause that endpoint to be marked as unhealthy. 如果未指定任何值,则使用默认值 3。If no value is specified, it uses the default value of 3.

  • 探测超时Probe timeout. 此属性指定在将运行状况检查探测数据发送到终结点时,将该项检查视为失败之前,流量管理器探测代理应该等待的时间。This property specifies the amount of time the Traffic Manager probing agent should wait before considering that check a failure when a health check probe is sent to the endpoint. 如果探测间隔设置为 30 秒,则可将超时值设置为 5 - 10 秒。If the Probing Interval is set to 30 seconds, then you can set the Timeout value between 5 and 10 seconds. 如果未指定任何值,将使用默认值 10 秒。If no value is specified, it uses a default value of 10 seconds. 如果探测间隔设置为 10 秒,则可将超时值设置为 5 - 9 秒。If the Probing Interval is set to 10 seconds, then you can set the Timeout value between 5 and 9 seconds. 如果未指定任何超时值,使用默认值 9 秒。If no Timeout value is specified, it uses a default value of 9 seconds.

    流量管理器终结点监视

    图 3:流量管理器终结点监视Figure: Traffic Manager endpoint monitoring

终结点监视功能的工作原理How endpoint monitoring works

如果监视协议设置为 HTTP 或 HTTPS,流量管理器探测代理将使用指定的协议、端口和相对路径向终结点发出 GET 请求。If the monitoring protocol is set as HTTP or HTTPS, the Traffic Manager probing agent makes a GET request to the endpoint using the protocol, port, and relative path given. 如果收到返回的 200-OK 响应,或者在“预期的状态代码 *范围” 中配置的任何响应,则认为该终结点正常。If it gets back a 200-OK response, or any of the responses configured in the Expected status code *ranges, then that endpoint is considered healthy. 如果响应是一个不同的值,或者在指定的超时期限内未收到的任何响应,则流量管理器探测代理会根据“容许的失败次数”设置重试(如果此设置为 0,则不执行重试)。If the response is a different value, or, if no response is received within the timeout period specified, then the Traffic Manager probing agent re-attempts according to the Tolerated Number of Failures setting (no re-attempts are done if this setting is 0). 如果连续失败次数超过“容许的失败次数”设置,则将该终结点标记为不正常。If the number of consecutive failures is higher than the Tolerated Number of Failures setting, then that endpoint is marked as unhealthy.

如果监视协议为 TCP,流量管理器探测代理将使用指定的端口发起 TCP 连接请求。If the monitoring protocol is TCP, the Traffic Manager probing agent initiates a TCP connection request using the port specified. 如果终结点响应了请求并提供了用于建立连接的响应,则将该运行状况检查标记为成功,并且流量管理器探测代理会重置 TCP 连接。If the endpoint responds to the request with a response to establish the connection, that health check is marked as a success and the Traffic Manager probing agent resets the TCP connection. 如果响应是一个不同的值,或者在指定的超时期限内未收到的任何响应,则流量管理器探测代理会根据“容许的失败次数”设置重试(如果此设置为 0,则不执行重试)。If the response is a different value, or if no response is received within the timeout period specified, the Traffic Manager probing agent re-attempts according to the Tolerated Number of Failures setting (no re-attempts are made if this setting is 0). 如果连续失败次数超过“容许的失败次数”设置,则将该终结点标记为不正常。If the number of consecutive failures is higher than the Tolerated Number of Failures setting, then that endpoint is marked unhealthy.

在上述所有情况下,流量管理器都会从多个位置探测,并且每个区域将执行连续失败判定。In all cases, Traffic Manager probes from multiple locations and the consecutive failure determination happens within each region. 这也意味着,终结点将以高于“探测间隔”设置的频率从流量管理器接收运行状况探测数据。This also means that endpoints are receiving health probes from Traffic Manager with a higher frequency than the setting used for Probing Interval.

备注

对于 HTTP 或 HTTPS 监视协议,在终结点端上采取的一种常见做法是在应用程序中实施一个自定义页 - 例如 /health.aspx。For HTTP or HTTPS monitoring protocol, a common practice on the endpoint side is to implement a custom page within your application - for example, /health.aspx. 为监视使用此路径可以执行应用程序特定的检查,例如,检查性能计数器或者验证数据库可用性。Using this path for monitoring, you can perform application-specific checks, such as checking performance counters or verifying database availability. 页面根据这些自定义检查返回相应的 HTTP 状态代码。Based on these custom checks, the page returns an appropriate HTTP status code.

流量管理器配置文件中的所有终结点共享监视设置。All endpoints in a Traffic Manager profile share monitoring settings. 如果需要对不同的终结点使用不同的监视设置,可以创建嵌套式流量管理器配置文件If you need to use different monitoring settings for different endpoints, you can create nested Traffic Manager profiles.

终结点和配置文件状态Endpoint and profile status

可以启用和禁用流量管理器配置文件和终结点。You can enable and disable Traffic Manager profiles and endpoints. 不过,也可以通过流量管理器的自动设置和过程来更改终结点状态。However, a change in endpoint status also might occur as a result of Traffic Manager automated settings and processes.

终结点状态Endpoint status

可以启用或禁用特定的终结点。You can enable or disable a specific endpoint. 可能仍处于正常状态的基础服务不受影响。The underlying service, which might still be healthy, is unaffected. 更改终结点状态可以控制流量管理器配置文件中终结点的可用性。Changing the endpoint status controls the availability of the endpoint in the Traffic Manager profile. 当某个终结点的状态为已禁用时,流量管理器不会检查其运行状况,该终结点不会包括在 DNS 响应中。When an endpoint status is disabled, Traffic Manager does not check its health and the endpoint is not included in a DNS response.

配置文件状态Profile status

使用配置文件状态设置可以启用或禁用特定的配置文件。Using the profile status setting, you can enable or disable a specific profile. 终结点状态影响单个终结点,而配置文件状态会影响整个配置文件(包括所有终结点)。While endpoint status affects a single endpoint, profile status affects the entire profile, including all endpoints. 禁用某个配置文件时,不会检查终结点的运行状况,并且不会在 DNS 响应中包括任何终结点。When you disable a profile, the endpoints are not checked for health and no endpoints are included in a DNS response. 会针对 DNS 查询返回 NXDOMAIN 响应代码。An NXDOMAIN response code is returned for the DNS query.

终结点监视器状态Endpoint monitor status

终结点监视器状态是流量管理器生成的值,显示终结点的状态。Endpoint monitor status is a Traffic Manager-generated value that shows the status of the endpoint. 不能手动更改此设置。You cannot change this setting manually. 终结点监视状态是终结点监视结果与所配置端点状态的组合。The endpoint monitor status is a combination of the results of endpoint monitoring and the configured endpoint status. 下表显示了终结点监视状态的可能值:The possible values of endpoint monitor status are shown in the following table:

配置文件状态Profile status 终结点状态Endpoint status 终结点监视器状态Endpoint monitor status 注释Notes
已禁用Disabled EnabledEnabled 非活动Inactive 配置文件已禁用。The profile has been disabled. 尽管终结点状态为“已启用”,但配置文件状态(“已禁用”)优先。Although the endpoint status is Enabled, the profile status (Disabled) takes precedence. 不会监视已禁用配置文件中的终结点。Endpoints in disabled profiles are not monitored. 会针对 DNS 查询返回 NXDOMAIN 响应代码。An NXDOMAIN response code is returned for the DNS query.
<任意><any> 已禁用Disabled 已禁用Disabled 终结点已禁用。The endpoint has been disabled. 不会监视已禁用的终结点。Disabled endpoints are not monitored. 该终结点不会包括在 DNS 响应中,因此也不会接收流量。The endpoint is not included in DNS responses, therefore, it does not receive traffic.
EnabledEnabled EnabledEnabled 联机Online 终结点受到监视,处于正常状态。The endpoint is monitored and is healthy. 该终结点会包括在 DNS 响应中,并且可以接收流量。It is included in DNS responses and can receive traffic.
EnabledEnabled EnabledEnabled 已降级Degraded 监视运行状况检查的终结点将要发生故障。Endpoint monitoring health checks are failing. 该终结点不会包括在 DNS 响应中,也不会接收流量。The endpoint is not included in DNS responses and does not receive traffic.
一种例外的情况是,如果所有终结点已降级,则这些终结点全部被视为在查询响应中返回。An exception to this is if all endpoints are degraded, in which case all of them are considered to be returned in the query response).
EnabledEnabled EnabledEnabled 正在检查终结点CheckingEndpoint 终结点受监视,但是,尚未收到首个探测的结果。The endpoint is monitored, but the results of the first probe have not been received yet. “正在检查终结点”是一种临时状态,在配置文件中添加或启用终结点后,通常会立即出现这种状态。CheckingEndpoint is a temporary state that usually occurs immediately after adding or enabling an endpoint in the profile. 处于此状态的终结点会包括在 DNS 响应中,并且可以接收流量。An endpoint in this state is included in DNS responses and can receive traffic.
EnabledEnabled EnabledEnabled 已停止Stopped 终结点指向的 Web 应用未运行。The web app that the endpoint points to is not running. 检查 Web 应用设置。Check the web app settings. 如果终结点的类型为嵌套终结点,并且子配置文件已禁用或处于非活动状态,则也可能会发生这种情况。This can also happen if the endpoint is of type nested endpoint and the child profile is disabled or is inactive.
不会监视“已停止”状态的终结点。An endpoint with a Stopped status is not monitored. 该终结点不会包括在 DNS 响应中,也不会接收流量。It is not included in DNS responses and does not receive traffic. 一种例外的情况是,如果所有终结点已降级,则这些终结点全部被视为在查询响应中返回。An exception to this is if all endpoints are degraded, in which case all of them will be considered to be returned in the query response.

有关如何为嵌套式终结点计算终结点监视状态的详细信息,请参阅嵌套式流量管理器配置文件For details about how endpoint monitor status is calculated for nested endpoints, see nested Traffic Manager profiles.

备注

如果 Web 应用并非在标准层或更高层中运行,应用服务上的监视器状态可能会变为“停止的终结点”。A Stopped Endpoint monitor status can happen on App Service if your web application is not running in the Standard tier or above. 有关详细信息,请参阅流量管理器与应用服务集成For more information, see Traffic Manager integration with App Service.

配置文件监视器状态Profile monitor status

配置文件监视状态是配置的配置文件状态与所有终结点的终结点监视状态值的组合。The profile monitor status is a combination of the configured profile status and the endpoint monitor status values for all endpoints. 下表描述了可能的值:The possible values are described in the following table:

配置文件状态(根据配置)Profile status (as configured) 终结点监视器状态Endpoint monitor status 配置文件监视器状态Profile monitor status 注释Notes
已禁用Disabled <任意> 或包含未定义终结点的配置文件。<any> or a profile with no defined endpoints. 已禁用Disabled 配置文件已禁用。The profile has been disabled.
EnabledEnabled 至少一个终结点的状态为“已降级”。The status of at least one endpoint is Degraded. 已降级Degraded 查看各终结点状态值,确定哪些终结点需要进一步的关注。Review the individual endpoint status values to determine which endpoints require further attention.
EnabledEnabled 至少一个终结点的状态为“联机”。The status of at least one endpoint is Online. 没有任何终结点的状态为“已降级”。No endpoints have a Degraded status. 联机Online 服务正在接受流量。The service is accepting traffic. 无需进一步执行操作。No further action is required.
EnabledEnabled 至少一个终结点的状态为“正在检查终结点”。The status of at least one endpoint is CheckingEndpoint. 没有任何终结点为“联机”或“已降级”状态。No endpoints are in Online or Degraded status. 正在检查终结点CheckingEndpoints 创建或启用配置文件时,将出现这种过渡状态。This transition state occurs when a profile if created or enabled. 正在首次检查终结点的运行状况。The endpoint health is being checked for the first time.
EnabledEnabled 配置文件中所有终结点的状态为“已禁用”或“已停止”,或者配置文件中没有定义终结点。The statuses of all endpoints in the profile are either Disabled or Stopped, or the profile has no defined endpoints. 非活动Inactive 没有任何终结点处于活动状态,但是配置文件的状态仍旧是“已启用”。No endpoints are active, but the profile is still Enabled.

终结点故障转移和恢复Endpoint failover and recovery

流量管理器定期检查每个终结点(包括不正常的终结点)的运行状况。Traffic Manager periodically checks the health of every endpoint, including unhealthy endpoints. 当终结点恢复正常时,流量管理器可以检测到这种状态,并将其重新加入轮转列表。Traffic Manager detects when an endpoint becomes healthy and brings it back into rotation.

发生以下任一事件时,终结点会变得不正常:An endpoint is unhealthy when any of the following events occur:

  • 如果监视协议为 HTTP 或 HTTPS:If the monitoring protocol is HTTP or HTTPS:
    • 收到非 200 响应,或者收到的响应不包括在“预期的状态代码范围”设置中指定的状态范围(包括其他 2xx 代码,或者 301/302 重定向)。 A non-200 response, or a response that does not include the status range specified in the Expected status code ranges setting, is received (including a different 2xx code, or a 301/302 redirect).
  • 如果监视协议为 TCP:If the monitoring protocol is TCP:
    • 收到非 ACK 或 SYN-ACK 响应,以响应流量管理器发送的用于尝试建立连接的 SYN 请求。A response other than ACK or SYN-ACK is received in response to the SYN request sent by Traffic Manager to attempt a connection establishment.
  • 超时。Timeout.
  • 导致无法访问终结点的其他任何连接问题。Any other connection issue resulting in the endpoint being not reachable.

有关针对失败的检查进行故障排除的详细信息,请参阅排查 Azure 流量管理器中的降级状态For more information about troubleshooting failed checks, see Troubleshooting Degraded status on Azure Traffic Manager.

下图中的时间线详细描述了流量管理器终结点的监视过程,该终结点具有以下设置:监视协议为 HTTP,探测间隔为 30 秒,容许的失败次数为 3,超时值为 10 秒,DNS TTL 为 30 秒。The timeline in the following figure is a detailed description of the monitoring process of Traffic Manager endpoint that has the following settings: monitoring protocol is HTTP, probing interval is 30 seconds, number of tolerated failures is 3, timeout value is 10 seconds, and DNS TTL is 30 seconds.

流量管理器终结点故障转移和故障回复顺序

图:流量管理器终结点故障转移和恢复顺序Figure: Traffic manager endpoint failover and recovery sequence

  1. GETGET. 对于每个终结点,流量管理器监视系统将对监视设置中指定的路径执行 GET 请求。For each endpoint, the Traffic Manager monitoring system performs a GET request on the path specified in the monitoring settings.

  2. “200 正常”或由流量管理器配置文件监视设置指定的自定义代码范围200 OK or custom code range specified Traffic Manager profile monitoring settings . 监视系统预期一条“‘200 正常’或由流量管理器配置文件监视设置指定的自定义代码范围”消息会在 10 秒钟内返回。The monitoring system expects an HTTP 200 OK or the or custom code range specified Traffic Manager profile monitoring settings message to be returned within 10 seconds. 如果收到该响应,该系统会认为云服务可用。When it receives this response, it recognizes that the service is available.

  3. 每隔 30 秒检查30 seconds between checks. 终结点运行状况检查每隔 30 秒重复一次。The endpoint health check is repeated every 30 seconds.

  4. 服务不可用Service unavailable. 该服务变得不可用。The service becomes unavailable. 在下次执行运行状况检查前,流量管理器不会知道该服务是否可用。Traffic Manager will not know until the next health check.

  5. 尝试访问监视路径Attempts to access the monitoring path. 监视系统执行了 GET 请求,但没有在 10 秒的超时期间内收到响应(也可能收到的是非 200 响应)。The monitoring system performs a GET request, but does not receive a response within the timeout period of 10 seconds (alternatively, a non-200 response may be received). 然后又尝试了三次,每隔 30 秒一次。It then tries three more times, at 30-second intervals. 如果其中一次尝试成功,尝试次数就会重置。If one of the tries is successful, then the number of tries is reset.

  6. 状态设置为“已降级”Status set to Degraded. 第四次连续失败后,监视系统将不可用终结点的状态标记为“已降级”。After a fourth consecutive failure, the monitoring system marks the unavailable endpoint status as Degraded.

  7. 流量转移到其他终结点Traffic is diverted to other endpoints. 流量管理器 DNS 名称服务器进行更新,流量管理器不再返回终结点来响应 DNS 查询。The Traffic Manager DNS name servers are updated and Traffic Manager no longer returns the endpoint in response to DNS queries. 新连接将定向到其他可用终结点。New connections are directed to other, available endpoints. 不过,包含此终结点的 DNS 响应可能仍由递归 DNS 服务器和 DNS 客户端缓存。However, previous DNS responses that include this endpoint may still be cached by recursive DNS servers and DNS clients. 在 DNS 缓存过期之前,客户端一直使用该终结点。Clients continue to use the endpoint until the DNS cache expires. DNS 缓存过期后,客户端将发出新的 DNS 查询并定向到其他终结点。As the DNS cache expires, clients make new DNS queries and are directed to different endpoints. 缓存持续时间由流量管理器配置文件中的 TTL 设置控制,例如,可以将其设置为 30 秒。The cache duration is controlled by the TTL setting in the Traffic Manager profile, for example, 30 seconds.

  8. 继续进行运行状况检查Health checks continue. 在终结点的状态为“已降级”后,流量管理器会继续检查该终结点的运行状况。Traffic Manager continues to check the health of the endpoint while it has a Degraded status. 当终结点恢复正常时,流量管理器可检测到这种状态。Traffic Manager detects when the endpoint returns to health.

  9. 服务重新联机Service comes back online. 该服务变得可用。The service becomes available. 终结点会在流量管理器中始终保持“已降级”状态,直至监视系统执行下一次运行状况检查。The endpoint retains its Degraded status in Traffic Manager until the monitoring system performs its next health check.

  10. 继续将流量定向到服务Traffic to service resumes. 流量管理器发送 GET 请求,并收到“200 正常”状态响应。Traffic Manager sends a GET request and receives a 200 OK status response. 服务已恢复正常状态。The service has returned to a healthy state. 流量管理器名称服务器进行更新,并开始在 DNS 响应中分发服务的 DNS 名称。The Traffic Manager name servers are updated, and they begin to hand out the service's DNS name in DNS responses. 当缓存的 DNS 响应(返回其他终结点)到期时,以及现有的到其他终结点的连接终止时,流量返回到该终结点。Traffic returns to the endpoint as cached DNS responses that return other endpoints expire, and as existing connections to other endpoints are terminated.

    备注

    由于流量管理器是在 DNS 级别工作的,因此不可能影响任何终结点的现有连接。Because Traffic Manager works at the DNS level, it cannot influence existing connections to any endpoint. 在终结点之间引导流量时(不管是通过更改配置文件设置来进行,还是在故障转移或故障回复期间进行),流量管理器都会将新连接引导到可用的终结点。When it directs traffic between endpoints (either by changed profile settings, or during failover or failback), Traffic Manager directs new connections to available endpoints. 不过,其他终结点可能仍会通过现有连接继续接收流量,直至相关会话被终止。However, other endpoints might continue to receive traffic via existing connections until those sessions are terminated. 若要耗尽现有连接的流量,应通过应用程序来限制适用于每个终结点的会话持续时间。To enable traffic to drain from existing connections, applications should limit the session duration used with each endpoint.

流量路由方法Traffic-routing methods

当某个终结点处于“已降级”状态时,不再会在 DNS 查询的响应中返回该终结点。When an endpoint has a Degraded status, it is no longer returned in response to DNS queries. 而是选择一个替代终结点并将其返回。Instead, an alternative endpoint is chosen and returned. 配置文件中配置的流量路由方法确定如何选择替代的终结点。The traffic-routing method configured in the profile determines how the alternative endpoint is chosen.

  • 优先级Priority. 终结点构成一个采用优先级的列表。Endpoints form a prioritized list. 将始终返回列表中第一个可用的终结点。The first available endpoint on the list is always returned. 如果终结点状态为“已降级”,则返回下一个可用的终结点。If an endpoint status is Degraded, then the next available endpoint is returned.
  • 加权Weighted. 根据分配的权重以及其他可用终结点的权重随机选择任何可用的终结点。Any available endpoint is chosen at random based on their assigned weights and the weights of the other available endpoints.
  • 性能Performance. 返回最靠近最终用户的终结点。The endpoint closest to the end user is returned. 如果终结点不可用,流量管理器会将流量转移给下一个最靠近 Azure 区域的终结点。If that endpoint is unavailable, Traffic Manager moves traffic to the endpoints in the next closest Azure region. 可以使用嵌套式流量管理器配置文件针对性能流量路由来配置替代故障转移计划。You can configure alternative failover plans for performance traffic-routing by using nested Traffic Manager profiles.
  • 地理Geographic. 返回基于查询请求 IP 映射的、为地理位置提供服务的终结点。The endpoint mapped to serve the geographic location based on the query request IP's is returned. 如果该终结点不可用,则不会选择另一个要故障转移到的终结点,因为一个地理位置只能映射到配置文件中的一个终结点(常见问题解答中提供了更多详细信息)。If that endpoint is unavailable, another endpoint will not be selected to failover to, since a geographic location can be mapped only to one endpoint in a profile (more details are in the FAQ). 我们建议客户在使用地理路由时,使用包含多个终结点的嵌套式流量管理器配置文件作为配置文件的终结点,这是一种最佳做法。As a best practice, when using geographic routing, we recommend customers to use nested Traffic Manager profiles with more than one endpoint as the endpoints of the profile.
  • MultiValue:返回多个映射到 IPv4/IPv6 地址的终结点。MultiValue Multiple endpoints mapped to IPv4/IPv6 addresses are returned. 收到此配置文件的查询时,系统会根据指定的“响应中的最大记录数”值返回正常终结点。 When a query is received for this profile, healthy endpoints are returned based on the Maximum record count in response value that you have specified. 响应的默认数量为两个终结点。The default number of responses is two endpoints.
  • 子网:返回映射到一组 IP 地址范围的终结点。Subnet The endpoint mapped to a set of IP address ranges is returned. 从该 IP 地址收到请求时,返回的终结点是针对该 IP 地址映射的终结点。When a request is received from that IP address, the endpoint returned is the one mapped for that IP address. 

有关详细信息,请参阅流量管理器流量路由方法For more information, see Traffic Manager traffic-routing methods.

备注

当所有符合条件的终结点处于降级状态时,正常的流量路由行为会发生一种例外情况。One exception to normal traffic-routing behavior occurs when all eligible endpoints have a degraded status. 流量管理器“尽最大努力”尝试, 其响应就好像所有处于“已降级”状态的终结点实际上处于联机状态一样Traffic Manager makes a "best effort" attempt and responds as if all the Degraded status endpoints actually are in an online state. 这种行为要优于替代方法,后者不会在 DNS 响应中返回任何终结点。This behavior is preferable to the alternative, which would be to not return any endpoint in the DNS response. 已禁用或已停止的终结点不受监视,因此,认为它们不符合接收流量的条件。Disabled or Stopped endpoints are not monitored, therefore, they are not considered eligible for traffic.

这种状态通常是服务配置不当造成的,例如:This condition is commonly caused by improper configuration of the service, such as:

  • 某个访问控制列表 (ACL) 正在阻止流量管理器运行状况检查。An access control list [ACL] blocking the Traffic Manager health checks.
  • 流量管理器配置文件中的监视端口或协议配置不当。An improper configuration of the monitoring port or protocol in the Traffic manager profile.

此行为的一个结果是,即使流量管理器运行状况检查没有正确进行配置,但从流量路由的角度来看,流量管理器似乎也运行正常。 The consequence of this behavior is that if Traffic Manager health checks are not configured correctly, it might appear from the traffic routing as though Traffic Manager is working properly. 但在这种情况下,不能发生会影响应用程序总体可用性的终结点故障转移。However, in this case, endpoint failover cannot happen which affects overall application availability. 必须检查配置文件是否显示“联机”状态而不是“已降级”状态。It is important to check that the profile shows an Online status, not a Degraded status. 状态为“联机”表示流量管理器运行状况检查按预期进行。An Online status indicates that the Traffic Manager health checks are working as expected.

有关针对失败的运行状况检查进行故障排除的详细信息,请参阅 Azure 流量管理器上的降级状态故障排除For more information about troubleshooting failed health checks, see Troubleshooting Degraded status on Azure Traffic Manager.

常见问题FAQs

后续步骤Next steps

了解流量管理器的工作原理Learn how Traffic Manager works

详细了解流量管理器支持的流量路由方法Learn more about the traffic-routing methods supported by Traffic Manager

了解如何创建流量管理器配置文件Learn how to create a Traffic Manager profile

在流量管理器终结点上排查降级状态Troubleshoot Degraded status on a Traffic Manager endpoint