Re: Force Sticky session on HaProxy
https://cbonte.github.io/haproxy-dconv/1.7/configuration.html#option redispatch On 18 Oct 2017 11:28 pm, "Devendra Joshi" <devendra.joshi9...@gmail.com> wrote: 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 <daniel.schneller@ centerdevice.com> 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=gmail=g> >| 42697 Solingen > tel: +49 1754155711 <+49%20175%204155711>| Deutschland > daniel.schnel...@centerdevice.de | 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) <gibs...@imsweb.com> > wrote: > > I've used peers for this situation personally. > > Sent from Nine<http://www.9folders.com/> > ________ > From: Aaron West <aa...@loadbalancer.org> > 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> > aa...@loadbalancer.org > > 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. > > >
Re: Force Sticky session on HaProxy
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 < daniel.schnel...@centerdevice.com> 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=gmail=g> >| 42697 Solingen > tel: +49 1754155711 <+49%20175%204155711>| Deutschland > daniel.schnel...@centerdevice.de | 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) <gibs...@imsweb.com> > wrote: > > I've used peers for this situation personally. > > Sent from Nine<http://www.9folders.com/> > ________ > From: Aaron West <aa...@loadbalancer.org> > 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> > aa...@loadbalancer.org > > 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. > > >
Re: Force Sticky session on HaProxy
Hi, maybe I am missing something, but isn’t this what http://cbonte.github.io/haproxy-dconv/1.6/configuration.html#4.2-cookie <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 | 42697 Solingen tel: +49 1754155711| Deutschland daniel.schnel...@centerdevice.de | 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) <gibs...@imsweb.com> wrote: > > I've used peers for this situation personally. > > Sent from Nine<http://www.9folders.com/ <http://www.9folders.com/>> > > From: Aaron West <aa...@loadbalancer.org <mailto:aa...@loadbalancer.org>> > 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/><http://www.loadbalancer.org > <http://www.loadbalancer.org/>> > > +1 888 867 9504 / +44 (0)330 380 1064 > aa...@loadbalancer.org <mailto:aa...@loadbalancer.org> > > 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.
Re: Force Sticky session on HaProxy
I've used peers for this situation personally. Sent from Nine<http://www.9folders.com/> From: Aaron West <aa...@loadbalancer.org> 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 / +44 (0)330 380 1064 aa...@loadbalancer.org 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.
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 +1 888 867 9504 / +44 (0)330 380 1064 aa...@loadbalancer.org LEAVE A REVIEW | DEPLOYMENT GUIDES | BLOG
Force Sticky session on HaProxy
Hi, Is anybody configured Force Sticky session in Haproxy (with JSESSIONID). I am using following things Centos 6.4 Apache 2.2 Jboss 4.0 ModJK and HaProxy 1.6.12 also check following setting in ModJK config but not succeed. cookie serverid insert indirect nocache stick-table type string len 36 size 1m expire 8h stick on cookie(JSESSIONID) I want to configure this on HaProxy level. If my one web-server goes down then client should not get disconnect , should wait for the web-server get up. If server get up withing time then client start communicating. Devendra Joshi 8080106035 -- --