1、haproxy.conf
global
chroot /root/gaproxy/haproxy/var/chroot
daemon
user haproxy
group haproxy
log 127.0.0.1:514 local0 warning
pidfile /root/gaproxy/haproxy/var/run/haproxy.pid
maxconn 20000
spread-checks 3
nbproc 1
defaults
log global
mode http
retries 3
option redispatch
contimeout 5000
clitimeout 50000
srvtimeout 50000
listen oldboytest
bind *:80
mode http
stats enable
stats hide-version
stats uri /admin?status
stats auth admin:oldboy123
balance roundrobin
option httpclose
option forwardfor
cookie SERVERID insert indirect
timeout server 15s
timeout connect 15s
server web1 192.168.1.38:80 cookie A weight 1 check port 80 inter 5000 fall 5
server web2 192.168.1.40:80 cookie B weight 2 check port 80 inter 5000 fall 5
2、用curl访问看是否轮询:
命令: for((i=0;i<10;i++));do curl http://192.168.1.37;sleep 2;done
结果:oldboy2
zhangfei
zhangfei
oldboy2
zhangfei
zhangfei
oldboy2
zhangfei
zhangfei
oldboy2
也实现的轮询
2、现在换成浏览器是否实现轮询:
用IE:
点刷新一直都只访问一个问题,不会换成另外一个页面
用世界之窗:
也是一样,点刷新不会轮询。
问题: 我想问下,是不是我哪里配置错了,但是curl为什么又能轮询。