I already read all the other threads on stackoverflow about the ECONNREFUSED error but still nothing worked. Currently I am working on Ubuntu 12.04.1 LTS
For tests I have this really simple code:
var redis = require("redis"),
client = redis.createClient(6379,"127.0.0.1");
redis.debug_mode = true;
client.on("connect", function () {
client.set("foo_rand000000000000", "some fantastic value");
});
But whenever I am starting it, all I get is the ECONNREFUSED error:
root@oncn05:~/ba# node test.js
hiredis parser not installed.
Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
at RedisClient.on_error (/root/ba/node_modules/redis/index.js:196:24)
at Socket.<anonymous> (/root/ba/node_modules/redis/index.js:106:14)
at Socket.emit (events.js:67:17)
at Array.0 (net.js:319:25)
at EventEmitter._tickCallback (node.js:192:41)
root@oncn05:~/ba#
The thing is: It is no problem to connect to redis with redis-cli
.
root@oncn05:~/ba# redis-cli
redis 127.0.0.1:6379>
Also the logs do not show anything suspicious.
Why is it even saying that the hiredis parser is not installed? I installed it with npm install hiredis
. But even if i didn't. Where is it even used?
I appreciate every help.
createClient
? – Jannjannasudo netstat -nlp4
show? – Greenheart