我在 OpenShift Container Platform v3.6 上部署了一个应用程序。它由彼此互连的多个服务组成。
前端服务调用后端服务的耗时功能(通过REST调用),但是在 30秒之后,它会收到“504网关超时”消息。 前端在nginx上运行,但是我已经为它配置了较长的代理发送/读取超时,因此504消息不是来自它。我认为它来自OpenShift Platform的服务代理组件,但是我无法确定在何处以及如何配置一种服务代理超时。我知道外部路由存在HAProxy超时,但是我的服务保留在同一群集应用程序中,并通过OpenShift容器平台DNS相互通信。
可能是服务代理超时问题?如何配置?
谢谢!
最佳答案
您的路由超时是罪魁祸首。 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
关于rest - OpenShift服务代理超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47812807/