跳转到内容
搜索文档

监控器与健康检查

最后更新 查看 MarkdownAgent 设置

然而,负载均衡器的功能远不止分发流量。

毕竟,如果你的负载均衡器和存储池将请求发送到离线的服务器,或者已经流量过载的服务器,那有什么用呢?理想情况下,你的负载均衡器应该只转发服务器能够处理的请求。

这就是负载均衡体系中另一个关键组成部分发挥作用的地方:监控器(monitors)与健康检查(health checks)。

    flowchart RL
      accTitle: 负载均衡监控流程
      accDescr: 监控器发出健康检查请求,以验证每个池内服务器的当前状态。
      Monitor[监控器] -- 健康检查 ----> Endpoint2
      Endpoint2 -- 响应 ----> Monitor
      subgraph Pool [池]
      Endpoint1((端点 1))
      Endpoint2((端点 2))
      end

工作原理

监控器定期发起健康检查,以评估存储池内每台服务器的健康状况。

Requests issued by a monitor at regular interval and — depending on the monitor settings — return a pass or fail value to make sure an endpoint is still able to receive traffic.

Each health monitor request is trying to answer two questions:

  1. Is the endpoint offline?: Does the endpoint respond to the health monitor request at all? If so, does it respond quickly enough (as specified in the monitor's Timeout field)?
  2. Is the endpoint working as expected?: Does the endpoint respond with the expected HTTP response codes? Does it include specific information in the response body?

If the answer to either of these questions is "No", then the endpoint fails the health monitor request.

这种请求与响应的机制确保了负载均衡器始终掌握哪些服务器能够处理传入的请求。

这篇文档对您有帮助吗?