Amazon ELB 自动运行状况检查有什么作用,它有什么期望? [英] What does the Amazon ELB automatic health check do and what does it expect?

查看:38
本文介绍了Amazon ELB 自动运行状况检查有什么作用,它有什么期望?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

事情是这样的:

  1. 我们已经实现了一个 C++ RESTful API 服务器,带有内置的 HTTP 解析器,没有像 apache 或任何类似的标准 HTTP 服务器
  2. 它已在 Amazon 结构中使用数月,使用普通和 SSL 通信,未发现与 Amazon 基础结构相关的问题
  3. 我们正在使用 Amazon ELB 部署我们的第一个后端
  4. Amazon ELB 有一个可定制的健康检查系统,但也有一个自动检查系统,如这里
  5. 我们没有发现有关运行状况检查系统发送了哪些数据的文档
  6. 后端简单挂在套接字读取指令上,最终关闭连接

我不是在寻找问题的解决方案,因为后端不是基于标准的 Web 服务器,只是如果有人知道 ELB 健康检查系统正在发送什么样的消息,因为我们发现没有任何地方的相关文档.

I'm not looking for a solution for the problem since the backend is not based on a standard web server, just if someone knows what kind of message is being sent by the ELB health check system, since we've found no documentation about this, anywhere.

非常感谢帮助.谢谢.

推荐答案

Amazon ELB 有一个可定制的健康检查系统,但也作为一个自动的,如此处

使用 customizable,您大概指的是通过 AWS 管理控制台配置的运行状况检查(请参阅 配置健康检查设置)或通过 API(请参阅 ConfigureHealthCheck).

With customizable you are presumably referring to the health check configurable via the AWS Management Console (see Configure Health Check Settings) or via the API (see ConfigureHealthCheck).

HealthCheck 数据类型文档:

The requirements to pass health checks configured this way are outlined in field Target of the HealthCheck data type documentation:

指定正在检查的实例.协议是 TCP,HTTP、HTTPS 或 SSL.有效端口的范围是一 (1) 到65535.

Specifies the instance being checked. The protocol is either TCP, HTTP, HTTPS, or SSL. The range of valid ports is one (1) through 65535.

注意

  • TCP 是默认的,指定为 TCP: 端口对,例如TCP:5000".在这种情况下,健康检查只是尝试打开一个 TCP连接到指定端口上的实例.连接失败在配置的超时内被认为是不健康的.

SSL 也指定为 SSL: 端口对,例如 SSL:5000.

SSL is also specified as SSL: port pair, for example, SSL:5000.

对于 HTTP 或 HTTPS 协议,情况有所不同.您必须在字符串中包含一个 ping 路径.HTTP 被指定为HTTP:端口;/;PathToPing;分组,例如HTTP:80/weather/us/wa/seattle".在这种情况下,HTTP GET 请求是颁发给给定端口和路径上的实例.任何其他答案在超时期限内超过200 OK"被认为是不健康的.

For HTTP or HTTPS protocol, the situation is different. You have to include a ping path in the string. HTTP is specified as a HTTP:port;/;PathToPing; grouping, for example "HTTP:80/weather/us/wa/seattle". In this case, a HTTP GET request is issued to the instance on the given port and path. Any answer other than "200 OK" within the timeout period is considered unhealthy.

HTTP ping 目标的总长度需要为 1024 16 位Unicode 字符或更少.

The total length of the HTTP ping target needs to be 1024 16-bit Unicode characters or less.

[强调我的]

使用自动,您大概指的是为什么健康检查 URL 与 API 和控制台中显示的 URL 不同?:

With automatic you are presumably referring to the health check described in paragraph Cause within Why is the health check URL different from the URL displayed in API and Console?:

除了您为负载均衡器配置的运行状况检查之外,服务执行第二次健康检查以防止实例被终止而导致的潜在副作用被注销.要执行此检查,负载均衡器会打开一个运行状况检查配置到的同一端口上的 TCP 连接使用,然后在健康检查结束后关闭连接完全的.[强调我的]

In addition to the health check you configure for your load balancer, a second health check is performed by the service to protect against potential side-effects caused by instances being terminated without being deregistered. To perform this check, the load balancer opens a TCP connection on the same port that the health check is configured to use, and then closes the connection after the health check is completed. [emphasis mine]

段落解决方案阐明了这里的有效负载为零,即它类似于上面为可配置的健康检查描述的非 HTTP/HTTPS 方法:

The paragraph Solution clarifies the payload being zero here, i.e. it is similar to the non HTTP/HTTPS method described for the configurable health check above:

这个额外的健康检查不会影响你的性能应用程序,因为它没有向您的后端发送任何数据实例.您无法禁用或关闭此运行状况检查.

This extra health check does not affect the performance of your application because it is not sending any data to your back-end instances. You cannot disable or turn off this health check.

总结/解决方案

假设您的 RESTful API 服务器,带有内置的 HTTP 解析器 应该确实只提供 HTTP 服务,您将需要处理两个健康检查:

Summary / Solution

Assuming your RESTful API Server, with built-in HTTP parser is supposed to serve HTTP only indeed, you will need to handle two health checks:

  1. 您将自己配置的第一个作为 HTTP:port;/;PathToPing - 您将收到一个 HTTP GET 请求,并且必须以 200 OK 回答 在指定的超时期限内被认为是健康的.
  2. 服务自动配置的第二个 - 它将在上面配置的 HTTP 端口上打开一个 TCP 连接,不会发送任何数据,然后在健康检查完成后关闭连接.
  1. The first one you configured yourself as a HTTP:port;/;PathToPing - you'll receive a HTTP GET request and must answer with 200 OK within the specified timeout period to be considered healthy.
  2. The second one configured automatically by the service - it will open a TCP connection on the HTTP port configured above, won't send any data, and then closes the connection after the health check is completed.

总而言之,您的服务器似乎已经运行得很好,而您只是对第二次健康检查的行为感到恼火 - ELB 真的认为您的服务器不健康吗?

In conclusion it seems that your server might be behaving perfectly fine already and you are just irritated by the 2nd health check's behavior - does ELB actually consider your server to be unhealthy?

这篇关于Amazon ELB 自动运行状况检查有什么作用,它有什么期望?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆