你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

排除负载均衡器运行状况事件日志故障

本文介绍如何排查 Azure 负载均衡器的常见运行状况事件日志问题。 它涵盖了使用 Azure 负载均衡器时可能会遇到的许多常见运行状况事件日志。

数据路径可用性警告事件

负载均衡器的数据路径可用性指标由于潜在的平台问题而下降到 90% 以下。 此事件也可能由达到其他 Azure 平台限制引起。

示例事件

Warning - DataPathAvailabilityWarning: The data path availability for frontend IP 20.29.152.178 is below 90% on the following ports: 80. To mitigate this issue, please refer to aka.ms/lbhealth for more detailed event definitions and troubleshooting guidance.

故障排除步骤

  1. 确认至少有一个后端实例正在响应与负载均衡规则关联的健康探测。 该规则包括事件说明中提供的前端 IP、协议和端口。
    1. 如果有,请转到 Azure 状态的下一步。
    2. 如果没有,请参阅“对 Azure 负载均衡器运行状况探测状态进行故障排除 |”,获取更详细的故障排除步骤。
  2. 访问 Azure 状态 ,确定是否存在可能影响负载均衡器资源的任何已知 Azure 平台或基础结构问题。
  3. 如果在日志中看到这些事件,并且遇到持续的连接问题,请联系 Azure 支持以进行进一步调查。

数据路径可用性关键事件

负载均衡器的 DataPathAvailability 指标由于潜在的平台问题而下降到 25% 以下。 此事件也可能由达到其他 Azure 平台限制引起。

示例事件

    Critical - DataPathAvailabilityCritical: The data path availability for frontend IP {FrontendIPAddress} is below 25% on the following ports: {LoadBalancingRulePorts}. To mitigate this issue, please refer to aka.ms/lbhealth for more detailed event definitions and troubleshooting guidance.

故障排除步骤

  1. 确认至少有一个后端实例正在响应与负载均衡规则关联的健康探测。 该规则包括事件说明中提供的前端 IP、协议和端口。
    1. 如果有,请转到 Azure 状态的下一步。
    2. 如果没有,请参阅排查 Azure 负载均衡器运行状况探测状态 | Microsoft Learn 以获取更详细的故障排除步骤。
  2. 访问 Azure 状态,确定是否存在可能影响负载均衡器资源的任何已知 Azure 平台或基础结构问题。
  3. 如果在日志中看到这些事件,并且遇到持续的连接问题,请联系 Azure 支持以进行进一步调查。

NoHealthyBackends 事件

您的负载均衡器的后端实例没有响应健康探测。 负载均衡器或后端实例的配置不当可能会导致此事件。 常见原因包括:

  • 防火墙或网络安全组规则正在拦截运行状况探测的 IP 地址或端口。
  • 应用程序未侦听已配置的运行状况探测端口,或者获配运行状况探测的端口有误。
  • 已配置 HTTP 运行状况探测,但应用程序未响应 200 OK 状态代码。

示例事件

Critical - NoHealthyBackends: the frontend IP {FrontendIPAddress} is completely unreachable because all backend instances configured to the following protocol:port {Protocol:Port, Protocol:Port,...} are not responding to health probes. Please review the associated health probe configuration(s) and ensure that at least one of the backend instances are responding to the health probes on the configured ports. To mitigate this issue, please refer to aka.ms/lbhealth for more detailed event definitions and troubleshooting guidance.

故障排除步骤

HighSnatPortUsage 事件

此事件表示您在特定后端实例上的 SNAT 端口即将耗尽。 想要查看出站连接体系结构。

示例事件

Warning - High SNAT Port Usage: Backend IP {BackendIPAddress} is utilizing more than 75% of SNAT ports allocated from frontend IP {FrontendIPAddress} and is at-risk for SNAT port exhaustion. To reduce the risk of SNAT exhaustion, please refer to aka.ms/lbhealth for more detailed event definitions and troubleshooting guidance.

故障排除步骤

  • 有关 Azure 的常见出站连接选项的详细信息,请参阅 出站连接的源网络地址转换 (SNAT) - Azure 负载均衡器
  • 对于生产方案,建议将 NAT 网关用于出站连接需求。 NAT 网关提供动态 SNAT 分配,从而减少由于 SNAT 端口耗尽而导致连接失败的风险。 有关改进出站连接体系结构的详细步骤,请参阅本文中 SnatPortExhaustion 事件部分下的“故障排除步骤”部分。

SnatPortExhaustion 事件

此事件表示一个或多个后端实例获配的所有 SNAT 端口都已耗尽。

示例事件

Critical - SNATPortExhaustion: Backend IP {BackendIPAddress} has exhausted all SNAT ports allocated to it.  One of the frontend IPs where the backend IP gets SNAT port is {FrontendIPAddress}. To reduce the risk of SNAT exhaustion, please refer to aka.ms/lbhealth for more detailed event definitions and troubleshooting guidance.

故障排除步骤

  1. 若要解决 SNAT 耗尽问题,建议改用 NAT 网关。 若要详细了解 NAT 网关如何降低 SNAT 端口耗尽的风险,请参阅有关 使用 Azure NAT 网关的源网络地址转换(SNAT)的详细信息。
  2. 如果当前使用的是负载均衡器出站规则,并且想要迁移到使用 NAT 网关,请参阅 教程:将出站访问迁移到 NAT 网关
  3. 若要识别由于 SNAT 端口耗尽而受影响的连接,请执行以下作:
    1. 在 Azure 门户中,选择负载均衡器资源。
    2. 在负载均衡器 概述中,选择左侧菜单中的 “监视>指标 ”。
    3. 在“指标”窗口中,将“指标”选为“SNAT 连接计数”,然后将“聚合”选为“Sum”。
    4. 选择 “应用拆分 ”并选择 “连接状态”的值。
    5. 如果 连接状态 等于 “失败”,则表示由于 SNAT 端口耗尽而失败的连接数。

替代解决方案

  1. 确保通过手动端口分配来配置出站规则,并尽可能分配最大数量的端口。
  2. 向负载均衡器或 NAT 网关添加额外的公共 IP。

网络平台限流激活事件

此事件表示由于吞吐量或带宽使用率较高,平台限速已应用于负载均衡器的前端 IP。 你可能想要使用多个前端 IP 横向扩展应用程序。

示例事件

Critical - NetworkPlatformThrottlingActive: At {DateTime} UTC, we detected that the load balancer with frontend IP configuration {FrontendIPAddress} exceeded platform-defined network thresholds. As a result, you may experience packet drops due to active network throttling. For detailed event definitions and troubleshooting guidance, please refer to aka.ms/lbhealth.

故障排除步骤

  • 调查应用程序是否收到意外流量,以及是否存在任何客户端问题导致流量增加
  • 如果这是预期的流量,请考虑通过跨多个前端 IP 配置或负载均衡器分配流量来横向扩展部署。
  • 如果在日志中看到这些事件,并且遇到持续的连接问题,请联系 Azure 支持以进行进一步调查。

后续步骤

本文介绍了如何对每个 Azure 负载均衡器运行状况事件类型进行故障排除。

有关 Azure 负载均衡器运行状况事件日志和运行状况事件类型的详细信息,或者如何使用这些日志收集、分析和创建警报,请参阅: