合并HAProxy统计信息? [英] Combine HAProxy stats?
问题描述
我有两个HAProxy实例.这两个实例均启用了统计信息,并且运行良好.
I have two instances of HAProxy. Both instances have stats enabled and are working fine.
我正在尝试将两个实例的统计信息合并为一个,以便可以使用单个HAProxy来查看前端/后端统计信息.我试图为两个haproxy实例在同一端口上提供stats侦听器,但这不起作用.我已经尝试过使用套接字接口,但这也只报告其中一个接口.
I am trying to combine the stats from both instances into one so that I can use a single HAProxy to view the front/backends stats. I've tried to have the stats listener on the same port for both haproxy instances but this isn't working. I've tried using the sockets interface but this only reports on one of the interfaces as well.
有什么想法吗?
我的一个haproxy配置文件如下所示:
My one haproxy config file looks like this:
global
daemon
maxconn 256
log 127.0.0.1 local0 debug
log-tag haproxy
stats socket /tmp/haproxy
defaults
log global
mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend http-in
bind *:8000
default_backend servers
log global
option httplog clf
backend servers
balance roundrobin
server ws8001 localhost:8001
server ws8002 localhost:8002
log global
listen admin
bind *:7000
stats enable
stats uri /
其他haproxy配置相同,除了前端/后端服务器IP不同.
The other haproxy config is the same except the front/backend server IPs are different.
推荐答案
这不起作用. Haproxy在每个过程中将统计信息分开.它没有能力合并多个进程的统计信息.
This can't work. Haproxy keeps stats separated in each process. It has no capabilities to combine stats of multiple processes.
也就是说,您当然可以随意使用外部监视工具,例如(munin,石墨或nagios),这些工具可以聚合来自多个统计套接字的CSV数据并将其显示在统一的图形中.但是,这些工具不在核心haproxy的保护范围之内.
That said, you are of course free to use external monitoring tools like (munin, graphite or even nagios) which can aggregate the CSV data from multiple stats sockets and display them in unified graphs. These tools are however out-of-scope of core haproxy.
这篇关于合并HAProxy统计信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!