我在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。这告诉我,请求正被重新分配给" living"服务器。这个假设是否正确?
这是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
答案 0 :(得分: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.