Hi guys,
I am very interesting about the haproxy and try to use it as our load
balancer. I want to use the appsession as the persistence method. but I got
a big problem that when I disable the cookie in browser. It will lost the
persistence and send me to another server sometimes.
I install it by on our 8 core, X86_64 server with RedHat 5.5
make TARGET=linux26 ARCH=x86_64
make install.
Here is my configuration for the haproxy.cfg file:
------------------------------------------------------------------------------------
lobal
maxconn 32000 # Total Max Connections. This is dependent on
ulimit
daemon
nbproc 3 # Number of processing cores. Dual Dual-core Opteron
is 4 cores for example.
pidfile /tmp/haproxy.pid
#stats maxconn 5
defaults
mode http
clitimeout 10000
srvtimeout 10000
contimeout 10000
#option httpclose # Disable Keepalive
log global
log 127.0.0.1 local3
option httplog
listen http_proxy 10.211.162.15:80
balance roundrobin # Load Balancing algorithm
option httpchk HEAD /status.jsp HTTP/1.0
option forwardfor # This sets X-Forwarded-For
stats enable
stats realm icebreakersoftware\ Haproxy
stats uri /admin
stats auth wade:wade
stats refresh 30s
stats hide-version
#option httpclose
capture cookie JSESSIONID len 52
#stick-table type string len 52 size 2g expire 1h
cookie HTTPSERVERID insert nocache indirect
#appsession JSESSIONID len 52 timeout 3h mode query-string
appsession JSESSIONID len 34 timeout 1h
#option ignore-persist if url_end .jpg
## Define your servers to balance
server server1 10.211.162.15:8280 weight 1 maxconn 15000 check inter
2000 rise 2 fall 3 cookie A
server server2 10.198.9.139:8280 weight 1 maxconn 15000 check inter
2000 rise 2 fall 3 cookie B
------------------------------------------------------------------------------------
Even I disable the line:
#cookie HTTPSERVERID insert nocache indirect
does my configuration is correct about the appsession?
Best Regards,
Hogan