Closed sandeepeecs closed 11 years ago
i think the issue is sockets.js
io.configure(function() { io.set('store', new sio.RedisStore); io.enable('browser client minification'); io.enable('browser client gzip'); });
change to :
io.configure(function() { io.set('store', new sio.RedisStore({client: client})); io.enable('browser client minification'); io.enable('browser client gzip'); });
it fixed my issue on the server but i just wanted to know if this is correct ?
yes it is. I'll fix it now. Thanks
when i try to deploy this app on heroku server. the app is trying to connect to 127.0.0.1 and not to the remote redis addon that i have added.
below are the logs.
State changed from up to starting 2012-10-29T14:57:02+00:00 heroku[web.1]: Starting process with command (/app/node_modules/redis/index.js:74:14)
2012-10-29T14:57:06+00:00 app[web.1]: at RedisClient.on_error (/app/node_modules/redis/index.js:140:24)
2012-10-29T14:57:06+00:00 app[web.1]: at Socket.EventEmitter.emit (events.js:93:17)
2012-10-29T14:57:06+00:00 app[web.1]: at Socket._destroy.self.errorEmitted (net.js:328:14)
2012-10-29T14:57:06+00:00 app[web.1]: at process.startup.processNextTick.process._tickCallback (node.js:244:9)
2012-10-29T14:57:06+00:00 app[web.1]: Exception: Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
2012-10-29T14:57:06+00:00 app[web.1]: at RedisClient.on_error (/app/node_modules/redis/index.js:140:24)
2012-10-29T14:57:06+00:00 app[web.1]: at Socket. (/app/node_modules/redis/index.js:74:14)
2012-10-29T14:57:06+00:00 app[web.1]: at Socket.EventEmitter.emit (events.js:93:17)
2012-10-29T14:57:06+00:00 app[web.1]: Exception: Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
2012-10-29T14:57:06+00:00 app[web.1]: at Socket._destroy.self.errorEmitted (net.js:328:14)
2012-10-29T14:57:06+00:00 app[web.1]: at process.startup.processNextTick.process._tickCallback (node.js:244:9)
2012-10-29T14:57:06+00:00 app[web.1]: at RedisClient.on_error (/app/node_modules/redis/index.js:140:24)
2012-10-29T14:57:06+00:00 app[web.1]: at Socket. (/app/node_modules/redis/index.js:74:14)
2012-10-29T14:57:06+00:00 app[web.1]: at Socket.EventEmitter.emit (events.js:93:17)
2012-10-29T14:57:06+00:00 app[web.1]: at Socket._destroy.self.errorEmitted (net.js:328:14)
2012-10-29T14:57:06+00:00 app[web.1]: at process.startup.processNextTick.process._tickCallback (node.js:244:9)
2012-10-29T14:57:09+00:00 app[web.1]: at RedisClient.on_error (/app/node_modules/redis/index.js:140:24)
2012-10-29T14:57:09+00:00 app[web.1]: at Socket. (/app/node_modules/redis/index.js:74:14)
2012-10-29T14:57:09+00:00 app[web.1]: at Socket.EventEmitter.emit (events.js:93:17)
2012-10-29T14:57:09+00:00 app[web.1]: at Socket._destroy.self.errorEmitted (net.js:328:14)
2012-10-29T14:57:09+00:00 app[web.1]: at process.startup.processNextTick.process._tickCallback (node.js:244:9)
2012-10-29T14:57:09+00:00 app[web.1]: Exception: Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
2012-10-29T14:57:09+00:00 app[web.1]: Exception: Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
2012-10-29T14:57:09+00:00 app[web.1]: at RedisClient.on_error (/app/node_modules/redis/index.js:140:24)
2012-10-29T14:57:09+00:00 app[web.1]: at Socket. (/app/node_modules/redis/index.js:74:14)
2012-10-29T14:57:09+00:00 app[web.1]:
node balloons.js
2012-10-29T14:57:03+00:00 heroku[web.1]: Stopping all processes with SIGTERM 2012-10-29T14:57:03+00:00 app[web.1]: logging env varibles redis env: redis://redistogo:1939b3c410e9dgfdg37f2fbb3fd4b23e1f8f5@sole.redistogo.com:9231/ 2012-10-29T14:57:03+00:00 app[web.1]: connecting to remote redis 2012-10-29T14:57:03+00:00 app[web.1]: info: socket.io started 2012-10-29T14:57:03+00:00 app[web.1]: Balloons.io started on port 20049 2012-10-29T14:57:03+00:00 app[web.1]: Deletion of sockets reference for each user >> Done! 2012-10-29T14:57:03+00:00 app[web.1]: Deletion of online users from rooms >> Done! 2012-10-29T14:57:03+00:00 app[web.1]: Deletion of socket.io stored sockets data >> Done! 2012-10-29T14:57:04+00:00 heroku[web.1]: State changed from starting to up 2012-10-29T14:57:05+00:00 heroku[web.1]: Process exited with status 1 2012-10-29T14:57:06+00:00 app[web.1]: Exception: Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 2012-10-29T14:57:06+00:00 app[web.1]: at Socket.