5.2. 查看 HAProxy 统计信息

默认情况下,director 还在所有 HA 部署中启用 HAProxy Stats 或 statistics。使用此功能,您可以在 HAProxy Stats 页面中查看有关数据传输、连接和服务器状态的详细信息。

director 还设置用来访问 HAProxy Stats 页面的 IP:Port 地址,并将信息存储在 haproxy.cfg 文件中。

先决条件

  • 高可用性部署并运行。

流程

  1. 在安装 HAProxy 的任何 Controller 节点,打开 /var/lib/config-data/puppet-generated/haproxy/haproxy.cfg 文件。
  2. 找到 listen haproxy.stats 部分:

    listen haproxy.stats
      bind 10.200.0.6:1993
      mode http
      stats enable
      stats uri /
      stats auth admin:<haproxy-stats-password>
  3. 在 Web 浏览器中,导航到 10.200.0.6:1993,并输入 stats auth 行中的凭证来查看 HAProxy Stats 页面。