OpenShift服务代理超时

时间:2017-12-14 11:56:28

标签: rest proxy timeout openshift haproxy

我在 OpenShift Container Platform v3.6 上部署了一个应用程序。它由多个彼此互连的服务组成。

前端 服务调用 后端 服务的耗时功能(通过REST调用),但在 30秒之后,它会收到&#34; 504网关超时&#34; 消息。 前端 会在 nginx 上运行,但我已经使用长代理发送/读取超时对其进行了配置,因此 504 < / em>消息并非来自它。我认为它来自OpenShift平台的 服务代理 组件,但我无法找到配置一种服务代理超时的位置和方式< / em>的。我知道外部路由存在 HAProxy 超时,但我的服务留在同一个集群应用程序中,并通过 OpenShift Container Platform DNS 相互通信。

可能是服务代理超时问题?怎么配置?

谢谢!

1 个答案:

答案 0 :(得分:8)

您的路线超时是罪魁祸首。 haproxy入口路由器正在终止请求。您可以按照以下文档配置超时:

https://docs.openshift.com/container-platform/3.5/install_config/configuring_routing.html

例如:

# Set the timeout on 'longrunningroute' to five minutes.
oc annotate route longrunningroute --overwrite haproxy.router.openshift.io/timeout=5m