【问题标题】:marathon-lb health check failing on all spray.io containers所有 spray.io 容器的 marathon-lb 健康检查失败
【发布时间】:2016-12-27 05:11:46
【问题描述】:

我正在使用 marathon-lb 运行 DC/OS 1.7。

spray.io 1.3.3 向所有 marathon-lb/HAProxy 健康检查调用返回 400:request has a relative URI and is missing a Host header 所以 marathon-lb 永远不会将任何请求路由到服务。

马拉松json中的健康检查是:

   "healthChecks": [
     {
       "path": "/health",
       "protocol": "HTTP",
       "portIndex": 0,
       "gracePeriodSeconds": 10,
       "intervalSeconds": 2,
       "timeoutSeconds": 10,
       "maxConsecutiveFailures": 10,
       "ignoreHttp1xx": false
     }   ],

spray.io 在 docker 容器中的日志记录是:

[警告] [08/19/2016 23:53:42.534] [asp-service-akka.actor.default-dispatcher-5] [akka://asp-service/user/IO-HTTP/listener-0/4] 非法请求, 以状态“400 Bad Request”响应:非法请求:不能 建立有效的请求URI HttpRequest(GET,/health,List(),Empty,HTTP/1.0),请求有相对 URI 并且缺少 Host 标头

/health 端点在 curl 对 mesos 管理的 ip:port 上运行良好。

我找不到任何有关通过 marathon-lb 使 HAProxy 更宽容或抑制 spray.io 的 400 的文档。

【问题讨论】:

    标签: spray mesosphere marathon dcos


    【解决方案1】:

    来自 mesosphere 团队,通过马拉松 json 中的 "labels": { 部分在标头中发送主机名:

        "HAPROXY_0_BACKEND_HTTP_HEALTHCHECK_OPTIONS": "  http-send-name-header Host\n  timeout check {healthCheckTimeoutSeconds}s\n"
    

    【讨论】:

    • 我已经找了好几天了!非常感谢。虽然我使用的是带有 Iron 框架的 rust 编写的服务器。
    【解决方案2】:
    猜你喜欢
    • 2021-12-18
    • 2019-05-05
    • 1970-01-01
    • 2018-06-05
    • 2022-08-04
    • 2020-12-18
    • 1970-01-01
    • 2015-01-23
    • 2017-06-09
    相关资源
    最近更新 更多