Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

External database with redis-connect?

External database with redis-connect?

Problem

I'm trying to connect to a 3rd party Redis Database with connect-redis. Any idea what's wrong?

app.use(express.session({ store: new RedisStore({host: keys.redis.url, port: keys.redis.port, db: keys.redis.db, pass: keys.redis.pass}), secret: 'keyboard cat' }));

Error: Redis connection to redis://the.db.com:9313 failed - getaddrinfo ENOENT at RedisClient.on_error (/node_modules/connect-redis/node_modules/redis/index.js:136:24) at Socket. (/node_modules/connect-redis/node_modules/redis/index.js:70:14) at Socket.emit (events.js:67:17) at Array.0 (net.js:562:16) at EventEmitter._tickCallback (node.js:192:40)

Problem courtesy of: Patrick

Solution

The host field of the object passed into the RedisStore constructor function should specify a hostname or IP address and not a url. This field is passed directly into a redis.createClient call as the host parameter: http://visionmedia.github.com/connect-redis/

Solution courtesy of: JohnnyHK

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

External database with redis-connect?

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×