【问题标题】:HAProxy - connection reset during transferHAProxy - 传输期间连接重置
【发布时间】:2015-01-30 10:57:08
【问题描述】:

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

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

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

这里是 haproxy.cfg:

听tomcat_frontend
绑定 *:8080
客户端超时 5000 毫秒
服务器超时 5000 毫秒
模式 http
选项 httpclose
选项 httplog
acl myservice_tomcat path_beg /myservice
use_backend tomcat_myservice_backend if myservice_tomcat
后端 tomcat_myservice_backend
选项转发
选项重新调度
重试 30
服务器 server-2 :8080 检查 inter 10
服务器 server-1 :8080 检查 inter 10
余额最小连接
模式http

【问题讨论】:

    标签: tomcat haproxy high-availability


    【解决方案1】:

    非常老的问题,但是“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.
    

    【讨论】:

      猜你喜欢
      • 2021-09-17
      • 2012-01-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-28
      • 2015-05-19
      • 2014-01-08
      • 2017-02-04
      相关资源
      最近更新 更多