中型网站架构部署笔记----HAproxy+keepalived
globallog 127.0.0.1 local0
log 127.0.0.1 local1 notice
chroot /usr/share/haproxy
uid 99
gid 99
daemon
maxconn 10000
defaults
#log global
log 127.0.0.1 local3
mode http
option httplog
option dontlognull
retries 3
optionredispatch
timeout connect 5000ms
timeout client50000ms
timeout server50000ms
stats uri /haproxy-admin
frontend http-in
bind 61.135.198.174:80
default_backend51-servers
backend 51-servers
balance static-rr
appsession PHPSESSID len 64 timeout 5hrequest-learn #将session信息保存在HAproxy服务器,防止轮询后端服务 器导致用户登录状态不一致的问题。亦可通过将负载方式 设置为source解决此问题
optionhttpchk HEAD /haproxy-health-check.htm HTTP/1.0
serverserver1 192.168.100.171:80 check inter 2000 rise 2 fall 3 weight 15
serverserver2 192.168.100.174:80 check inter 2000 rise 2 fall 3 weight 10
页:
[1]