Re: Persistence Issue

From: Unai Rodriguez <me#u-journal.org>
Date: Mon, 10 Nov 2008 20:44:09 -0700


Dear Brenden,

I do it in this way:

  1. I set balance to "source"
  2. I declare the cookie lines as: "cookie XXXX insert indirect nocache"

Example:



listen EXAMPLE 10.20.30.40:80
        mode    http
        cookie  EXAMPLE insert indirect nocache
        balance source
        server  SRV1 10.20.30.41:80 cookie s1 check inter 1200 rise 2 fall
3
        server  SRV2 10.20.30.42:80 cookie s2 check inter 1200 rise 2 fall
3 
        option  abortonclose
        option  httpclose
	source  10.20.30.40
--------------------------------------------

As far as I understand (covered before on the list, unfortunately I do not have the link to the discussion) this method will use cookies to keep the requests to the same server. If the client is not able to keep cookies, then the "balance source" will redirect the client to the same backend server as far as the number of servers remains constant.

best regards,
unai

On Sun, 9 Nov 2008 22:00:44 -0500, "Brenden Bixler" <brenden.bixler#gmail.com> wrote:
> Hello all.
>
> I am having a little trouble configuring HA-Proxy 1.2.17 on FreeBSD 7.
> Specifically, I want to enable persistence, so that once a request
> hits server A, all future requests during that session stay on server
> A.
>
> Server A is running FreeBSD 7, Apache 2x, Tomcat 6 using mod_jk on port
> 8080.
> Server B is running FreeBSD 7, Tomcat 6 standalone on 8081.
> I can go to either server via its IP Address and everything works as
> expected.
>
> My current config file:
>
> defaults
> log global
> mode http
>
> listen http_proxy
> bind :80
> mode http
> balance roundrobin
> cookie jSessionID prefix
> srvtimeout 10000
> retries 2
> option httpchk HEAD /sa
> server web1 XXX.XXX.XXX.XXX:8080 cookie server01 check
> server web2 YYY.YYY.YYY.YYY:8081 cookie server02 check
> redispatch
>
> This doesn't work either:
>
> listen http_proxy :80
> mode http
> cookie SERVERID
> balance roundrobin
> server web1 XXX.XXX.XXX.XXX:8080 cookie server01
> server web2 YYY.YYY.YYY.YYY:8081 cookie server02
>
> Any suggestions would be greatly appreciated.
>
> Thanks,
>
> Brenden Bixler
>
Received on 2008/11/11 04:44

This archive was generated by hypermail 2.2.0 : 2008/11/11 04:45 CET