【问题标题】:Haproxy stats for multiple fronends多个前端的 Haproxy 统计信息
【发布时间】:2018-09-15 10:28:06
【问题描述】:

我为 haproxy 配置了三个前端:http7001、http7002 和 http7003,使用相同的后端 在配置中启用统计信息为:

listen stats *:9001
mode http
stats enable
stats realm Haproxy\ Statistics
stats uri /haproxy_stats
stats auth admin:admin

每次我通过浏览器(对于常规 html)或 curl(对于 csv)点击 haproxy_stats 页面时,我只会获取配置的前端之一(随机 http7001 或 http7002 或 http7003)的前端统计信息 例如:

响应#1

http7001,FRONTEND,,,0,18,2000,162045,858272517,3395311531,0,0,307,,,,,OPEN,,,,,,,,,1,1,0,,,,0, 1,0,101,,,,0,150399,5097,990,5742,18,,1,101,162246,,,0,0,0,0,,,,,,, ,,

响应#2

http7003,FRONTEND,,,0,38,2000,213336,1306426186,3217983292,0,0,315,,,,,OPEN,,,,,,,,,3,3,0,,,,0, 0,0,103,,,,0,200323,6419,863,5839,48,,0,103,213492,,,,0,0,0,0,,,,,,,,,

试图在互联网上搜索如何一次获取所有已配置前端的统计信息,或者指定在发送的请求中获取统计信息的前端,但实际上没有找到任何可能表明我“我做了一些根本错误的事情......虽然三个前端指向相同的后端配置对我来说看起来并不太奇特,而且效果很好。

【问题讨论】:

    标签: haproxy


    【解决方案1】:

    发现于Combine HAProxy stats? “Haproxy 在每个进程中保持统计信息分离。它没有能力组合多个进程的统计信息” 这正是我的情况。每个前端都配置了自己的进程

    frontend http7001
    bind-process 1
    
    frontend http7002
    bind-process 2
    
    frontend http7003
    bind-process 3
    

    作为解决方案,我已经配置了三个端点来访问相应的前端统计信息

    listen stats1 *:9001
    mode http
    bind-process 1
    stats enable
    ... 
    
    listen stats2 *:9002
    mode http
    bind-process 2
    stats enable
    ...
    
    listen stats3 *:9003
    mode http
    bind-process 3
    stats enable
    ...
    

    现在我可以分别访问每个前端统计信息了

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-05
      • 1970-01-01
      • 2010-12-18
      • 1970-01-01
      • 2019-09-04
      相关资源
      最近更新 更多