所有spray.io容器

时间:2016-08-20 00:09:34

标签: spray mesosphere marathon dcos

我正在使用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
     }   ],

并且在docker容器中使用spray.io进行日志记录是:

  

[WARN] [08/19/2016 23:53:42.534]   [ASP服务-akka.actor.default-调度-5]   [akka:// asp-service / user / IO-HTTP / listener-0/4]非法请求,   回复状态'400 Bad Request':非法请求:不能   建立有效的请求URI   HttpRequest(GET,/ health,List(),Empty,HTTP / 1.0),请求有一个亲戚   URI并缺少Host标题

对于mesos managed ip:port,/health端点可以正常工作。

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

enter image description here

2 个答案:

答案 0 :(得分:3)

来自中间层团队的

通过马拉松json中的"labels": {部分在标题中发送主机名:

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

enter image description here

答案 1 :(得分:1)

相关问题