Session affinity on load balancer

为君一笑 提交于 2019-12-06 12:14:42

问题


We have a situation, where we are talking to a set of app servers(B) directly from another application(A). Since both are within the same SAN, we are making the httpClient Call directly connecting to application servers(from A to B) . For scaling purposes, we have put a load balancer in between(httpclient requests from A to B), but we want to make the subsequent requests goto same JVM on application(B). Hence we are looking if we can configure session affinity on load balancer, if you have experiences or insight on how this problem can be solved please let me know.


回答1:


The most common way is to use a cookie like JSESSIONID to guide the load balancer.

With Apache + mod_proxy_balancer for example, define it like this:

ProxyPassMatch /.* balancer://mycluster stickysession=JSESSIONID|jsessionid



来源:https://stackoverflow.com/questions/4885515/session-affinity-on-load-balancer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!