HAProxy - 传输期间的连接重置

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

我在tomcat中部署的2个webapps前使用HAProxy。在测试高可用性时,我发出了10000个请求,并且在某些时候我杀死了一个tomcat实例。对于1或2个请求,我会收到一些错误。我的请求是使用Spring的RestTemplate发送的。以下是例外:“org.springframework.web.client.ResourceAccessException:POST请求中的I / O错误”http://:8080 / myservice / _doaction“:来自服务器的文件意外结束;嵌套异常是java.net .SocketException:来自服务器的文件意外结束“

HAProxy统计信息在“错误”部分“Resp”子部分中显示,当我将鼠标悬停在那里显示的数字时,即2:“传输期间连接重置:1个客户端,2个服务器”。这意味着什么?

此外,在“警告”部分,我有“Retr”:29和“Redis”:1。这告诉我请求被重新分配到“活”服务器。这个假设是否正确?

这是haproxy.cfg:

listen tomcat_frontend 
bind *:8080
timeout client 5000ms
timeout server 5000ms
mode http
option httpclose
option httplog
acl myservice_tomcat path_beg /myservice
use_backend tomcat_myservice_backend if myservice_tomcat
backend tomcat_myservice_backend
option forwardfor
option redispatch
retries 30
server server-2 :8080 check inter 10
server server-1 :8080 check inter 10
balance leastconn
mode http
tomcat haproxy high-availability
1个回答
0
投票

非常古老的问题,但是对于“retr”错误的顶级搜索命中之一。 CSV docs的一些信息('w'前缀表示警告,'e'表示错误):

eresp [..BS]: response errors. srv_abrt will be counted here also.
     Some other errors are:
     - write error on the client socket (won't be counted for the server stat)
     - failure applying filters to the response.
wretr [..BS]: number of times a connection to a server was retried.
wredis [..BS]: number of times a request was redispatched to another
     server. The server value counts the number of times that server was
     switched away from.
© www.soinside.com 2019 - 2024. All rights reserved.