2016-08-20 35 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