2016-08-20 98 views
1

我正在运行与马拉松磅的DC/OS 1.7。马拉松磅健康检查失败所有spray.io容器

spray.io 1.3.3正在返回400到所有marathon-lb/HAProxy健康检查呼叫: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在泊坞窗容器中的记录是:

[WARN] [08/19/2016 23:53:42.534] [asp-service-akka.actor.default-dispatcher-5] [akka://asp-service/user/IO-HTTP/listener-0/4] Illegal request, responding with status '400 Bad Request': Illegal request: Cannot establish effective request URI of HttpRequest(GET,/health,List(),Empty,HTTP/1.0), request has a relative URI and is missing a Host header

/health端点工作正常,没有卷曲反对mesos管理ip:port。

我找不到通过马拉松磅使HAProxy的更宽容或抑制的任何文档spray.io的400

enter image description here

回答

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

我一直在寻找这个好几天吧!非常感谢。尽管我使用Iron框架编写的防火墙服务器。 – zaynetro

1
+0

THX。我尝试{hostname}并得到KeyError:'hostname' – navicore

+0

https://gist.github.com/navicore/cbfecfea1af7e2d6212ca67bc06f04ed – navicore