排查负载均衡器运行状况事件日志问题
在本文中,你将了解如何排查 Azure 负载均衡器的常见运行状况事件日志问题。 本文涵盖了使用 Azure 负载均衡器时可能会遇到的许多常见运行状况事件日志。
DataPathAvailabilityWarning 事件
由于潜在的平台问题,负载均衡器的数据路径可用性指标降至 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.
疑难解答步骤
- 确认至少有一个后端实例正在响应获配相关负载平衡规则的运行状况探测。 规则包括事件描述中提供的前端 IP、协议和端口。
- 如果有,请转到 Azure 状态的下一步。
- 如果没有,请参阅“对 Azure 负载均衡器运行状况探测状态进行故障排除 |”,获取更详细的故障排除步骤。
- 访问 Azure 状态,确定是否存在任何已知的可能会影响负载均衡器资源的 Azure 平台或基础设施问题。
- 如果你在日志中观察到这些事件并且持续遇到连接问题,请联系 Azure 支持以开展进一步调查。
DataPathAvailabilityCritical 事件
由于潜在的平台问题,负载均衡器的 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.
疑难解答步骤
- 确认至少有一个后端实例正在响应获配相关负载平衡规则的运行状况探测。 规则包括事件描述中提供的前端 IP、协议和端口。
- 如果有,请转到 Azure 状态的下一步。
- 如果否,请参阅排查 Azure 负载均衡器运行状况探测状态 | Azure 了解更详细的故障排除步骤。
- 访问 Azure 状态,确定是否存在任何已知的可能会影响负载均衡器资源的 Azure 平台或基础设施问题。
- 如果你在日志中观察到这些事件并且持续遇到连接问题,请联系 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.
疑难解答步骤
请参阅“对 Azure 负载均衡器运行状况探测状态进行故障排除 |”,了解后端实例未响应配置的运行状况探测的常见原因。
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.
疑难解答步骤
- 若要解决 SNAT 耗尽问题,建议改用 NAT 网关。 若要详细了解 NAT 网关如何降低 SNAT 端口耗尽的风险,请参阅使用 Azure NAT 网关进行源网络地址转换 (SNAT),了解更多信息。
- 如果当前使用的是负载均衡器出站规则并想要改用 NAT 网关,请参阅教程:将出站访问迁移到 NAT 网关。
- 若要识别由于 SNAT 端口耗尽而受影响的连接,请执行以下操作:
- 在 Azure 门户中,选择负载均衡器资源。
- 在负载均衡器概述中,选择左侧菜单中的“监视”>“指标”。
- 在“指标”窗口中,将“指标”选为“SNAT 连接计数”,然后将“聚合”选为“Sum”。
- 选择“应用拆分”,然后选择“连接状态”的值。
- 如果连接状态等于“失败”,则表示由于 SNAT 端口耗尽而失败的连接数。
替代解决方案
- 确保通过手动分配端口配置了出站规则,并分配了尽可能多的端口。
- 向负载均衡器或 NAT 网关添加额外的公共 IP。
后续步骤
在本文中,你将了解如何排查各个 Azure 负载均衡器的运行状况事件类型问题。
有关 Azure 负载均衡器运行状况事件日志和运行状况事件类型的详细信息,或者如何使用这些日志收集、分析和创建警报,请参阅: