【问题标题】:haproxy statistics page crashes continueshaproxy 统计页面崩溃继续
【发布时间】:2013-07-30 05:11:49
【问题描述】:

我正在使用 haproxy 进行负载平衡,它工作得非常愉快。

我设置了一个统计页面,此页面有时会在刷新时返回“连接已重置”。

listen status 0.0.0.0:8080

stats enable

stats refresh 5s

stats uri /admin    

这是一个错误还是存在一些配置问题?

谢谢!

【问题讨论】:

    标签: connection statistics reset haproxy was


    【解决方案1】:

    首先“崩溃”意味着进程死亡,但事实并非如此。这里发生的事情(但是当您启动该过程时应该有警告)是统计页面是在 TCP 侦听器中定义的,而不是在 HTTP 侦听器中定义的。所以你需要添加:

    mode http
    

    让它工作。 此外,您应该收到有关超时等的其他警告...请在寻求帮助之前修复警告,因为它们通常会报告您所面临问题的原因。

    【讨论】:

    • 感谢您的回答。我的 Haproxy 版本是 1.4.23,但启动时没有收到警告。我将配置更改为以下内容:listen status 0.0.0.0:1082 #log global mode http contimeout 15s clitimeout 15s srvtimeout 15s stats enable stats refresh 5s stats uri /admin addtional,这是我的配置文件中的默认部分:
    • 问题依然存在。而且我没有收到有关超时的警告。
    • 啊确实你有一个包含所有这些设置的默认部分,解释了为什么你没有警告。然而,该问题是由“选项 nolinger”引起的,该选项恰好通过重置关闭。除非您确切知道原因,否则永远不要使用它!
    • 谢谢!当我从设置中删除“选项 nolinger”时,它可以工作。
    【解决方案2】:

    另外,这是我的配置文件中的默认部分(如果有帮助的话):

    defaults  
    
    log     global
    
    mode    http  
    
    option  httplog 
    
    option  dontlognull
    option  nolinger
    
    option  redispatch  
    
    retries 3
    
    maxconn 50000 
    
    contimeout 15s 
    
    clitimeout 15s 
    
    srvtimeout 15s 
    

    【讨论】:

      猜你喜欢
      • 2013-12-10
      • 2014-03-11
      • 2016-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-03
      相关资源
      最近更新 更多