Hi Aaron,

Here is my haproxy configure

frontend kylin-web
    bind 192.168.1.120:7077
    acl url_static       path_beg       -i /kylin
    stats enable
    stats uri /haproxy?stats
    stats realm Strictly\ Private
    default_backend             app
#---------------------------------------------------------------------
backend app
    balance     roundrobin
    server  hdp01.example.local 192.168.1.100:7070   check
    server  hdp02.example.local 192.168.1.101:7070   check

HAproxy:

When I login  to LB 192.168.1.120:7077/kylin and do query. I can see request 
loadbalance to all backend server( no need re-authentication). First request to 
HDP01, second request to HDP02 and third request to HDP01……

But when I use RESTful API following this docs 
http://kylin.apache.org/docs16/howto/howto_use_restapi.html
I using cookie to save authentication, that mean client do not need 
re-authentication for each request sent. So problem happen here,
Example when client login to LB, it create JSESSIONID and save to cookie. 
JSESSIONID point to only HDP01 server so all subsequent request go to this 
server. When client authentication again, JSESSIONID point to only HDP02 server 
and all subsequent request go to this server.

So what I want here:
Client login to LB, request sent will be forward balance to HDP01 and HDP02 
server, client no need re-authentication.


Thanks!

From: Aaron West [mailto:[email protected]]
Sent: Tuesday, February 07, 2017 5:14 PM
To: Hoang Le Trung
Cc: [email protected]
Subject: Re: Haproxy loabalance with cookie

Hi Hoang,

Could we get your HAproxy config please, an example of both scenarios would be 
best.

It may help to better to better understand your situation.

Aaron West

Loadbalancer.org Limited
+44 (0)330 380 1064
www.loadbalancer.org<http://www.loadbalancer.org/>

On 7 February 2017 at 01:55, Hoang Le Trung 
<[email protected]<mailto:[email protected]>> wrote:
Hi

I use HAproxy to loadblance my backend servers.
But I have problem when I using cookie.
When a cookie is present, the same backend server is used until it dies. So it 
make overload on this server while other servers free.
If not using cookie, Each client need pass authentication to request data from 
backend servers. It work ok but take long time to finish many requests from 
client.
So any solution for my case, I want use Haproxy to load balance session with 
client and backend server. When client send request, it will forward balance to 
backend servers( not only one server when use cookie). And client do not need 
re-authentication when send subsequent request


Thanks!
Best  Regards,
------------------------

________________________________
This e-mail may contain confidential or privileged information. If you received 
this e-mail by mistake, please don't forward it to anyone else, please erase it 
from your device and let me know so I don't do it again.


________________________________
This e-mail may contain confidential or privileged information. If you received 
this e-mail by mistake, please don't forward it to anyone else, please erase it 
from your device and let me know so I don't do it again.

Reply via email to