I working with node.js by expressjs
I try to store an account to session. So, i try to test to use session with code in expressjs
var RedisStore = require('connect-redis')(express);
app.use(express.bodyParser());
app.use(express.cookieParser());
app.use(express.session({ secret: "keyboard cat", store: new RedisStore }));
but I got error Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
.
Please help me resolve this problem
After you install redis, type from terminal:
redis-server
and you'll have redis running
I solve this problem in next way:
sudo apt-get install redis-server
then run command to confirm that everything ok:
sudo service redis-server status
redis-server is running
I used ubuntu 12.04 I solved that problem by installing redis-server
redis-server installation for ubuntu 12.04
some configuration will new root permission Also listed manuals for other OS
Thanks
I also have the same problem, first I tried to restart redis-server by sudo service restart
but the problem still remained. Then I removed redis-server
by sudo apt-get purge redis-server
and install it again by sudo apt-get install redis-server
and then the redis was working again. It also worth to have a look at redis log which located in here /var/log/redis/redis-server.log
For windows platform, You must check if redis-server
is running on given ip:port. you can find redis configuration at installation directory /conf/redis.conf
. by default client accept 127.0.0.1:6379
.
I'm on windows, and had to install Redis from here and then run redis-server.exe
.
From the top of this SO question.
I'm on MBP , and install redis detail my problem was resolved .Fixed the Download, extract and compile Redis with:
$ wget http://download.redis.io/releases/redis-3.0.2.tar.gz
$ tar xzf redis-3.0.2.tar.gz
$ cd redis-3.0.2
$ make
The binaries that are now compiled are available in the src directory.
Run Redis with:
$ src/redis-server
Try upgrading your node to latest version.
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
version 0.4 may not work properly.