您的位置:首页 > 其它

对haproxy代理流程的数据进行抓包分析

2012-07-05 12:54 525 查看
对haproxy代理流程的数据进行抓包分析




各模块名称以及作用



haproxy.cfg文件配置如下

global
maxconn 20480
log 127.0.0.1 local3
chroot /var/haproxy
uid 99
gid 99
daemon
nbproc 1
pidfile /var/run/haproxy.pid
ulimit-n 65535
defaults
log global
mode http
maxconn 20480
option httplog
option httpclose
option dontlognull
option forwardfor
option redispatch
option abortonclose
stats refresh 30
retries 3
balance roundrobin
contimeout 5000
clitimeout 50000
srvtimeout 50000
timeout check 2000

listen  admin_status
bind 0.0.0.0:65532
mode http
log 127.0.0.1 local3 err
stats refresh 5s
stats uri /admin?stats
stats realm itnihao\ itnihao
stats auth admin:admin
stats auth admin1:admin1
stats hide-version
stats admin if TRUE
errorfile 403 /etc/haproxy/errorfiles/403.http
errorfile 500 /etc/haproxy/errorfiles/500.http
errorfile 502 /etc/haproxy/errorfiles/502.http
errorfile 503 /etc/haproxy/errorfiles/503.http
errorfile 504 /etc/haproxy/errorfiles/504.http

capture request  header Host           len 40
capture request  header Content-Length len 10
capture request  header Referer        len 200
capture response header Server         len 40
capture response header Content-Length len 10
capture response header Cache-Control  len 8
listen  site_status
bind 0.0.0.0:1081
mode http
log 127.0.0.1 local3 err
monitor-uri /site_status
acl site_dead nbsrv(server_web) lt 2
monitor fail if site_dead

frontend  http_80_in
bind 0.0.0.0:80
mode http
log global
option httplog
option httpclose
option forwardfor
acl itnihao_web hdr_reg(host) -i ^(www.itnihao.cn|ww1.itnihao.cn)$
acl itnihao_blog hdr_dom(host) -i blog.itnihao.cn
use_backend  server_web  if itnihao_web
use_backend  server_blog if itnihao_blog
default_backend server_bbs

backend server_web
mode http
balance roundrobin
cookie SERVERID
option httpchk GET /index.html
server web1 192.168.16.2:80 cookie web1 check inter 1500 rise 3 fall 3 weight 1
server web2 192.168.16.3:80 cookie web2 check inter 1500 rise 3 fall 3 weight 2

backend server_bbs
mode http
balance roundrobin
cookie SERVERID
option httpchk GET /index.html
server bbs1 192.168.16.2:80 cookie bbs1 check inter 1500 rise 3 fall 3 weight 1
server bbs2 192.168.16.3:80 cookie bbs2 check inter 1500 rise 3 fall 3 weight 2
........具体看作者blog

本文出自 “itnihao的运维技术博客” 博客,请务必保留此出处/article/4292623.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: