HAproxy监测工具(HaTop)

dudu_ting HAHAproxy监测工具(HaTop)已关闭评论23,0964字数 2687阅读8分57秒阅读模式

1.什么是HaTop

HATop 是一个交互式的基于 ncurses 开发的实时监控 HAProxy 负载均衡系统的统计工具。后来有人对该工具进行改进,增加了 TCP 支持

2.安装部署

在安装之前需要开启haproxy的sock文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

修改文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

 /etc/haproxy/haproxy.cfg文件中的global部分,添加
 stats socket /tmp/haproxy.sock

下载安装包文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

cd /usr/local/src/
wget https://github.com/Wirehive/hatop/archive/master.zip

安装文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

unzip master.zip 
cd hatop-master/
install -m 755  bin/hatop /usr/local/bin
install -m 644 man/hatop.1 /usr/local/share/man/man1
gzip /usr/local/share/man/man1/hatop.1

以上可以直接复制黏贴就可以实现了,具体的参数在hatop-master/README  可以了解到文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

3.HaTop使用

hatop -s /tmp/haproxy.sock

haproxy文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

按q键退出,运行界面分为5大块      (界面切换分别按 1 2 3 4 5 来选择)文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

很多参数在上面的hatop-master/README  文件中可以了解的,界面也很清晰的告诉我们多少个机器是OK的文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

In STATUS mode
--------------
::文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

ACT         server is active (server), number of active servers (backend)  存货机器
BCK         server is backup (server), number of backup servers (backend)  备份机器
QCUR        current queued requests  当前队列请求
QMAX        max queued requests   最大队列请求
SCUR        current sessions  当前会话
SMAX        max sessions 最大会话
SLIM        sessions limit   会话限制
STOT        total sessions  总会话数文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

In TRAFFIC mode
---------------
::文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

LBTOT       total number of times a server was selected  每个服务器被选中的次数
RATE        number of sessions per second over last elapsed second  过去一秒的会话运行次数
RLIM        limit on new sessions per second  在每秒新建会话限制
RMAX        max number of new sessions per second 每秒最大连接数
BIN         bytes in (IEEE 1541-2002)
BOUT        bytes out (IEEE 1541-2002)文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

In HTTP mode
------------
::文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

RATE        HTTP requests per second over last elapsed second  过去1妙http请求
RMAX        max number of HTTP requests per second observed
RTOT        total number of HTTP requests received
1xx         number of HTTP responses with 1xx code
2xx         number of HTTP responses with 2xx code
3xx         number of HTTP responses with 3xx code
4xx         number of HTTP responses with 4xx code
5xx         number of HTTP responses with 5xx code
?xx         number of HTTP responses with other codes (protocol error)文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

In ERRORS mode
--------------
::文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

CF          number of failed checks
CD          number of UP->DOWN transitions
CL          last status change
ECONN       connection errors
EREQ        request errors
ERSP        response errors
DREQ        denied requests
DRSP        denied responses
DOWN        total downtime文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

Health check status reference
=============================
::文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

UNK         unknown
INI         initializing
SOCKERR     socket error
L4OK        check passed on layer 4, no upper layers testing enabled
L4TMOUT     layer 1-4 timeout
L4CON       layer 1-4 connection problem, for example
"Connection refused" (tcp rst) or "No route to host" (icmp)
L6OK        check passed on layer 6
L6TOUT      layer 6 (SSL) timeout
L6RSP       layer 6 invalid response - protocol error
L7OK        check passed on layer 7
L7OKC       check conditionally passed on layer 7, for example 404 with
disable-on-404
L7TOUT      layer 7 (HTTP/SMTP) timeout
L7RSP       layer 7 invalid response - protocol error
L7STS       layer 7 response error, for example HTTP 5xx文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/


haproxy文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

可以通过给该命令行查询一些服务器信息,可以敲“help”命令查询命令文章源自运维生存时间-https://www.ttlsa.com/cluster/haproxy-hatop/

 

 

weinxin
我的微信
微信公众号
扫一扫关注运维生存时间公众号,获取最新技术文章~
dudu_ting
  • 本文由 发表于 10/06/2015 17:06:08
  • 转载请务必保留本文链接:https://www.ttlsa.com/cluster/haproxy-hatop/