免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1903 | 回复: 0
打印 上一主题 下一主题

问一个haproxy+keepalived的奇怪问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-09-18 13:19 |只看该作者 |倒序浏览
配了haproxy+keepalived做负载均衡,后面是两台nginx,确认keepalived的虚ip只在一台haproxy上,haproxy的策略是roundrobin,但是发现通过haproxy转发一个请求时,会同时转发到两台nginx,而不是轮询,有谁知道这可能是什么原因造成的?

haproxy的配置:

global
     maxconn 20480
     ulimit-n 65535
     daemon
     nbproc 1
     pidfile /var/run/haproxy.pid

defaults
     mode http

     log 127.0.0.1 local0
     option httplog
     option httpclose
     option forwardfor
     option dontlognull
     option redispatch

     retries 3
     timeout check 2000
     contimeout 5000
     clitimeout 5000
     srvtimeout 5000

     # stats
     stats uri /stats
     stats auth admin:admin
     stats refresh 10s
     stats realm haproxy\ statistic
     #stats admin if TRUE

frontend web
     bind *:80
     default_backend fdfs_lg_nginxcluster

backend fdfs_lg_nginxcluster
     balance roundrobin
     server nginx_192.168.56.91 192.168.56.91:81 check inter 2000 rise 3 fall 3 weight 5
     server nginx_192.168.56.93 192.168.56.93:81 check inter 2000 rise 3 fall 3 weight 5

haproxy.log:
Sep 18 13:18:46 localhost haproxy[20384]: 192.168.56.1:49971 [18/Sep/2014:13:18:46.261] fdfs-lg.dhapp.com fdfs_lg_nginxcluster/nginx_192.168.56.91 0/0/0/0/9 200 781045 - - ---- 0/0/0/0/0 0/0 "GET /g1/M00/1B/61/wKg4XVQRWYqAUSwEAAvqH_kipG8256.jpg HTTP/1.1"
Sep 18 13:18:46 localhost haproxy[20384]: 192.168.56.1:49972 [18/Sep/2014:13:18:46.318] fdfs-lg.dhapp.com fdfs_lg_nginxcluster/nginx_192.168.56.93 9/0/1/0/42 200 781045 - - ---- 0/0/0/0/0 0/0 "GET /g1/M00/1B/61/wKg4XVQRWYqAUSwEAAvqH_kipG8256.jpg HTTP/1.1"
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP