Tag: redis

Can't SET/GET with NodeJS and Redis

I want to write a ueberDB Redis-Handler for my Etherpad. I absolutely do not understand my problem because with PHP I can set and get key/values without any problems. It only does not work with NodeJS. Here is a example code: var redis = require(“redis”); client = redis.createClient(); client.on(“error”, function (err) { console.log(“Error ” + […]

How to copy RedisToGo database in Heroku to local machine?

I have a node.js app, using RedisToGo and running in Heroku. I would like to copy the Redis To Go database to localhost for testing. When developing Ruby on Rails app, I can use heroku db:pull command. Is there any similiar command which I can use for node.js and Redis? Thanks.

how to define functions in redis \ lua?

I’m using Node.js, and the ‘redis-scripto’ module, and I’m trying to define a function in Lua: var redis = require(“redis”); var redisClient = redis.createClient(“6379″,””); var Scripto = require(‘redis-scripto’); var scriptManager = new Scripto(redisClient); var scripts = {‘add_script’:’function add(i,j) return (i+j) end add(i,j)’}; scriptManager.load(scripts); scriptManager.run(‘add_script’, [], [1,1], function(err, result){ console.log(err || result); }); so I’m getting […]

testing node.js with expresso – redis session store

I am trying to learn TDD with node.js. I’ve hit this issue with expresso where the expresso command just hangs, I think because of the redis-server. Killing the process with ctrl+C finally gives the output I’m looking for (100% 3 tests passed). What’s causing the expresso command to hang, and what can I do about […]

Build Error when Installing Socket.IO on Ubuntu 14.04

I seem to be getting the same error over several times. I keep getting this (node-gyp rebuild 2> builderror.log) || (exit 0) message. What exactly is it? Also is the node.js redis module no longer included with socket.io? ubuntu@ip-10-180-52-29:~$ sudo npm install socket.io > ws@0.4.31 install /home/ubuntu/node_modules/socket.io/node_modules/engine.io/node_modules/ws > (node-gyp rebuild 2> builderror.log) || (exit 0) […]

Using the same redis.createClient() instance for publish and subscribe

I’m working with redis to publish and subscribe messages between socket.io clients, when client connects to the server (io.sockets.on(‘connection’, function(socket){…});) i’m creating a subscribe variable using redis.createClient() and then using the subscribe function to subscribe the client to channel. My question is if its right to use the same subscribe variable to do a publish […]

Starting redis server on nodejitsu

On local development, you start a redis server using the “redis-server” command. However when I deploy the project to nodejitsu (using jitsu deploy), there isn’t an interface to run this command, and launching the deployed app gives the following error: Error: Redis connection to failed – connect ECONNREFUSED How do I startup redis on […]

Redis – Using Incr value in a transaction

Is it possible to use multi.incr(value) with multi.hmset? I mean: var name = ‘Josh’; var multi = client.multi(); multi.incr(‘id’); // incr => 1 multi.hmset(‘user:’ + <need incr value here>, ‘username’, name); // I want multi.hmset(‘user:1’, ‘username’, ‘Josh’); multi.exec(function(err,data){ .. }); My objective is to increment ‘id’, and then set it to a user id in […]

Using node-passport with subdomains

I have a node.js app using express connect-redis to store sessions. I’m also using vhost for a password protected user app: app.use(express.vhost(‘users.mydomain.com’, require(‘./users/app’))); This works fine but I want to see if a user is logged in when they are in www.mydomain.com. I tried adding this to session(): cookie: { domain:’.yourdomain.com’} When I do this […]

Scaling of Nodejs Socket.io Redis architecture

I know there are many q&a and resources on scaling Nodejs Socket.io, and I have read up quite alot. I am thinking of a simple deployment architecture on the cloud such as AWS that I will like to validate with the experts out here. Is my diagram correct? Is this the way to scale? If […]

Node.js is the Best Javascript runtime in the world.