Hi Daniel , Following is the case.
[image: Inline images 1] My Query is : 1: When users are serving the webpages,and my *Apache1 *get down, HaProxy shifted the traffic to *Apache2*. But i don't want to shift this traffic to *Apache2 *when my *Apache1 *is down, cause my application is session base. I want, those are serving from *Apache1 *, they should keep on *Apache1*. not to shift on *Apache2*. I want to apply Force sticky session in Haproxy. Devendra Joshi 8080106035 -------------------------------------------------------------- -------------------------------------------------------------- On 18 October 2017 at 17:37, Daniel Schneller < [email protected]> wrote: > Hi, > > maybe I am missing something, but isn’t this what > http://cbonte.github.io/haproxy-dconv/1.6/configuration.html#4.2-cookie is > supposed to do for you? > We are using this (in prefix mode) to make sure the same JSESSIONID gets > to the same backend every time. > As the information is in the cookie, there is no state to be lost on the > haproxy side. > > Daniel > > -- > Daniel Schneller > Principal Cloud Engineer > > CenterDevice GmbH | Hochstraße 11 > <https://maps.google.com/?q=Hochstra%C3%9Fe+11&entry=gmail&source=g> > | 42697 Solingen > tel: +49 1754155711 <+49%20175%204155711> | Deutschland > [email protected] | www.centerdevice.de > > Geschäftsführung: Dr. Patrick Peschlow, Dr. Lukas Pustina, > Michael Rosbach, Handelsregister-Nr.: HRB 18655, > HR-Gericht: Bonn, USt-IdNr.: DE-815299431 > > > On 18. Oct. 2017, at 11:58, Gibson, Brian (IMS) <[email protected]> > wrote: > > I've used peers for this situation personally. > > Sent from Nine<http://www.9folders.com/> > ________________________________ > From: Aaron West <[email protected]> > Sent: Oct 18, 2017 5:33 AM > To: Devendra Joshi > Cc: HAProxy > Subject: Re: Force Sticky session on HaProxy > > I've used something like this before: > > stick store-response res.cook(JSESSIONID) > stick match req.cook(JSESSIONID) > > "stick on" does this I think: > > stick match req.cook(JSESSIONID) > stick store-request req.cook(JSESSIONID) > > As the client doesn't have the cookie at the beginning of the > connection it has to wait to store it until it's received from the > server, I have a vague memory that I had issues with using simply > "stick on" for this so switched to the first method above. > > There is a massive problem with my suggestion however, if you clear > the stick table or restart the service(Which will clear the stick > table) then users lose persistence until they close their browsers and > start a new session or the server issues a new cookie. Obviously > reloads while synchronising the stick table should be fine. > > However, i'm sure there will be a far better solution so I'm just > starting the ball rolling really... > > Aaron West > > Loadbalancer.org Ltd. > > www.loadbalancer.org<http://www.loadbalancer.org> > > +1 888 867 9504 <+1%20888-867-9504> / +44 (0)330 380 1064 > <+44%20330%20380%201064> > [email protected] > > LEAVE A REVIEW | DEPLOYMENT GUIDES | BLOG > > > ________________________________ > > Information in this e-mail may be confidential. It is intended only for > the addressee(s) identified above. If you are not the addressee(s), or an > employee or agent of the addressee(s), please note that any dissemination, > distribution, or copying of this communication is strictly prohibited. If > you have received this e-mail in error, please notify the sender of the > error. > > >

