Session backup on a non-sticky AWS setup
Hi Magro,
I've been doing some testing in aws running with this config:-
<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
storageKeyPrefix="static:xxxx"
memcachedNodes="${elasticache.location}"
memcachedProtocol="binary"
sticky="false"
sessionBackupAsync="false"
sessionBackupTimeout="300"
requestUriIgnorePattern=".*\.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|htm|html|js|css|mp3|swf|ico|flv)$"
/>
With a non sticky elb and 2 tomcats and 2 autodiscovery memcached nodes I was expecting sessions to be created in one with a backup in the other as bak: as we had with the non discovery setup outside of aws. I've tested it out and was forced to re-login to our application when I failed one of the elasticache nodes. The docs do say it was only tested with a sticky setup or am I missing a config option to force sessions to be backed up.
Hi Giles,
your expectation is correct. Do you have any insight into what's stored in elasticache so that you could check? Have you tested this scenario outside aws? Do you see any exceptions in tomcat logs? You could also set logging to debug to get a better understanding on what's going on.
HTH, Martin
@gilesw can we close this issue?
@magro better late than never here! So I did do extensive failover testing outside of aws and the feature of backing up sessions to another node is great because it means if a memcached node dies there's a seemless connection to the other node.
However with the autodiscovery the sessions I suspect are being sharded across the cluster:-
http://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/AutoDiscovery.HowAutoDiscoveryWorks.html
but without the backups so when one node dies some users will be kicked out. Is there a way we could use the discovery mechanism of the client to report back the X number of hosts and use them in the config as specific memcached machines so backups can be made?
@gilesw great to hear from you :-) I'm sorry to say that I'm currently very loaded at work so that I can't work on msm. So you'd have to check out the client code and see what's possible, as I don't know the internals of the aws memcached client.