mardi 20 janvier 2015

How to use Redis as a session storage for multiple aws instances or ELB?

I am beginner to use redis-server in my nodejs application I am using redis server as a session-store for my app as:



var RedisStore = require('connect-redis')(express);


var admin_session = express.session({ key: 'admin_token', store: new RedisStore({ host: 'localhost', port: 6379, db: 2 // pass: 'RedisPASS' }), secret: 'aersda@#$32sfas2342' });


This is working fine for single instance. But my query is for multiple instance serving from aws elb.


Actually I want redis server as a cluster which clear the session for all the instances if any changes is available inside any of the instance and cleared all the code level caching.


If its possible can anybody help me how to do this and whats the steps?


Thanks in advance, Vijay





Aucun commentaire:

Enregistrer un commentaire