Skip to content

Instantly share code, notes, and snippets.

@cendrizzi
Created August 27, 2013 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cendrizzi/0d505d42abadb67f4cee to your computer and use it in GitHub Desktop.
Save cendrizzi/0d505d42abadb67f4cee to your computer and use it in GitHub Desktop.
socket.io redis setup code
pub = irisRedis.createClient(6379,'nodejitsudb6339009772.redis.irstack.com', {auth: "auth_key"});
sub = irisRedis.createClient(6379,'nodejitsudb6339009772.redis.irstack.com', {auth: "auth_key"});
client = irisRedis.createClient(6379,'nodejitsudb6339009772.redis.irstack.com', {auth: "auth_key"});
pub.on("error", function(err) {
console.error("Error connecting to redis (pub)", err);
});
sub.on("error", function(err) {
console.error("Error connecting to redis (sub)", err);
});
client.on("error", function(err) {
console.error("Error connecting to redis (client)", err);
});
pub.on("connect", function () {
console.log('Redis Connection Successful (pub)');
});
sub.on("connect", function () {
console.log('Redis Connection Successful (sub)');
});
client.on("connect", function () {
console.log('Redis Connection Successful (client)');
});
io.set('store', new RedisStore({
redis : irisRedis,
redisPub : pub,
redisSub : sub,
redisClient : client
}));
@cendrizzi
Copy link
Author

Just got this:

Error: Auth error: undefined
[08/27 11:40:42 MDT][err] at Command.RedisClient.do_auth.self.send_anyway as callback
[08/27 11:40:42 MDT][err] at RedisClient.flush_and_error (/opt/run/snapshot/package/node_modules/iris-redis/node_modules/redis/index.js:126:25)
[08/27 11:40:42 MDT][err] at RedisClient.connection_gone (/opt/run/snapshot/package/node_modules/iris-redis/node_modules/redis/index.js:423:10)
[08/27 11:40:42 MDT][err] at Socket. (/opt/run/snapshot/package/node_modules/iris-redis/node_modules/redis/index.js:91:14)
[08/27 11:40:42 MDT][err] at Socket.EventEmitter.emit (events.js:93:17)
[08/27 11:40:42 MDT][err] at TCP.onread (net.js:418:51)
[08/27 11:40:42 MDT][err] events.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment