如何配置HAProxy的状态统计页面?
- By : Will
- Category : Load balancing

Load balancing
1 前言
一个问题,一篇文章,一出故事。
笔者今天想通过http的web页面查看haproxy的服务器状态,于是整理此文。
2 最佳实践
2.1 环境信息
2.2 配置状态页面
2.2.1 增加配置
vim /etc/haproxy/haproxy.cfg
加入如下配置,
#... listen stats # Define a listen section called "stats" bind :8080 # Listen on localhost: mode http stats enable # Enable stats page stats hide-version # Hide HAProxy version stats realm Haproxy\ Statistics # Title text for popup window stats uri /stats # Stats URI stats auth admin:adminpwd # Authentication credentials
配置创建后,建议你使用如下命令测试配置,
haproxy -c -f /etc/haproxy/conf.d
2.2.2 重载服务使配置生效
systemctl reload haproxy
没有评论