Amazon Load Balancer sticky sessions with ajp:8009

2.7k views Asked by At

We configured ELB with sticky sessions for the JSESSIONID cookie for two tomcats (tomcat1 and tomcat2)(Flow is - Apache Http Server - ELB - tomcats)

AJP protocol with port 8009 has been configured on tomcat side as from AWS ELB there is no AJP option, we have configured with tcp:8009

So the Apache httpd.conf entry is, (xxx.amazonaws.com is ELB name)

BalancerMember ajp://xxx.amazonaws.com:8009

Somehow the sticky session is not working, the http request is sent to both tomcat servers. Is it because of the protocol on ELB side (tcp:8009)? We are not sure what is missing here, Need help!!

1

There are 1 answers

1
jazzed On

Once you change it to TCP you lose sticky sessions. It is an ELB limitation. You might be able to get away with switching the protocol to HTTP but with a different port other than 80.

Unless I am mistaken, you might have to setup an HA Proxy or something else instead of the ELB. Something that can do both TCP with sticky.

It is well know that websockets+sticky doesn't work on amazon.

https://forums.aws.amazon.com/thread.jspa?messageID=627367