uWSGI和Zuul:其他所有请求都失败

问题描述 投票:3回答:1

我有一个设置(微服务),其中Zuul网关(本地主机)位于随uWSGI服务的flask REST API应用程序(本地主机:8080)的前面。

当我尝试通过网关访问API(例如curl http://localhost/api/endpoint)时,其他所有请求均失败(HTTP 500)。 API端没有日志,这是非常密集的网关的异常日志的摘录:

com.netflix.zuul.exception.ZuulException: Forwarding error
...
Caused by: com.netflix.client.ClientException: null
...
Caused by: java.lang.RuntimeException: org.apache.http.NoHttpResponseException: localhost:8080 failed to respond

尽管,当我直接到达API(例如curl http://localhost:8080/api/endpoint)时,它[[工作得很好(所有请求均按预期处理)。

另一个有趣的事情是,当我尝试通过网关

如果使用flask的开发服务器

而不是uWSGI到达API时,[[它起作用”>这是我的uWSGI设置:[uwsgi] wsgi-file = api.py callable = app uid = api gid = api master = true processes = 2 threads = 2 http-timeout = 300 socket-timeout = 300 harakiri = 300 http = 0.0.0.0:8080 socket = /tmp/uwsgi.socket chmod-sock = 664 vacuum = true die-on-term = true wsgi-disable-file-wrapper = true log-date = %%Y-%%m-%%d %%H:%%M:%%S logformat-strftime = true logformat = %(ftime) | uWSGI | %(addr) (%(proto) %(status)) | %(method) %(uri) | %(pid):%(wid) | Returned %(size) bytes in %(msecs) ms to %(uagent)

版本是spring-cloud-netflix-zuul-2.1.1.RELEASE.jaruwsgi==2.0.17.1

Wireshark检查显示TCP 8080 -> 80 [RST] Seq=123 Win=0 Len=0

任何想法这里可能是什么问题?

我有一个设置(微服务),其中Zuul网关(localhost)位于随uWSGI服务的flask REST API应用(localhost:8080)的前面。当我尝试通过网关访问API时(例如curl http:// ...

java python uwsgi netflix-zuul
1个回答
1
投票
© www.soinside.com 2019 - 2024. All rights reserved.