2016-08-20 17 views
1

私はDC/OS 1.7 with marathon-lbを実行しています。marathon-lbすべてのspray.ioコンテナでヘルスチェックが失敗する

spray.io 1.3.3はすべてのマラソン-1b/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:ポート。

私はマラソンポンドより寛容または抑制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

私はこれを数日前から探してきました!どうもありがとう。私は鉄のフレームワークでサビに書かれたサーバーを使用していますが。 – zaynetro

1

経由HAProxyを作る上の任意のドキュメントを見つけることができませんあなたがwwwを交換しようとすることができ、HAPROXY_BACKEND_HTTP_HEALTHCHECK_OPTIONSラベルを追加してみてください。 https://github.com/mesosphere/marathon-lb/wiki#custom-http-headers-in-health-check

追加リンク:

    この例では {hostname}と中間圏チームから
  1. https://github.com/mesosphere/marathon-lb/blob/master/Longhelp.md#haproxy_backend_http_healthcheck_options
  2. https://cbonte.github.io/haproxy-dconv/1.6/configuration.html#4.2-option%20httpchk
+0

THX。私は{hostname}を試して、KeyError: 'hostname'を取得しました – navicore

+0

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

関連する問題