Redis connection failed with 127.0.0.1:6379 - connect ECONNREFUSED

I work with node.js expressjs
I am trying to save an account in a session. So, I am trying to verify the use of a 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 a Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED error Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED .
Please help me solve this problem.

+114
javascript session express redis
Jan 06 '12 at 6:40
source share
16 answers

After installing redis, enter from the terminal:

 redis-server 

and you will use redis

+205
Jun 21 '12 at 23:16
source share

I solve this problem as follows:

 sudo apt-get install redis-server 

then run the command to confirm that everything is fine:

 sudo service redis-server status 

And the result will be: redis-server is running - this means that the problem is resolved.

+55
Jan 27 '15 at 6:16
source share

Install redis on your system first -

 brew install redis 

then start the redis server -

 redis-server 
+27
Aug 03 '16 at 5:40
source share

I am on Windows and I had to install Redis from here and then run redis-server.exe .

From the top of this SUCH question .

+14
04 Feb '15 at 2:36
source share

A simple solution:

just click below, recommend once and restart your server again

 redis-server 
+8
Oct 09 '18 at 9:39
source share

I have the same problem too, at first I tried to restart redis-server on sudo service restart , but the problem still remained. Then I uninstalled redis-server on sudo apt-get purge redis-server and installed it again on sudo apt-get install redis-server , and then redis worked again. It is also worth taking a look at the redis log located here /var/log/redis/redis-server.log

+4
Jul 15 '14 at 13:32
source share

I used ubuntu 12.04 I solved this problem by installing redis-server

installing redis server for ubuntu 12.04

some configuration will have a new root permission. Also listed are manuals for other OS

thank

+3
Mar 29 '14 at 4:41
source share

for Windows users, you can use Chocolatey to install Redis

 choco install redis-64 

then start the server from

 C:\ProgramData\chocolatey\lib\redis-64\redis-server.exe 
+3
Jun 08 '18 at 8:27
source share

Using Windows 10? Go here: https://docs.microsoft.com/en-us/windows/wsl/install-win10.

Then run ...

  $ wget https://github.com/antirez/redis/archive/5.0.4.tar.gz <- change this to whatever Redis version you want (https://github.com/antirez/redis/releases) $ tar xzf redis-5.0.2.tar.gz $ cd redis-5.0.2 $ make 
+2
Dec 09 '18 at 8:58
source share

For the Windows platform, you should check if redis-server is redis-server on the specified ip: port. you can find the redis configuration in the installation directory /conf/redis.conf . by default, the client accepts 127.0.0.1:6379 .

+1
21 Sep '13 at 6:14
source share

I am on MBP and install redis in detail, my problem is solved. 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 

Compiled binaries are available in the src directory.

Launch Redis with:

 $ src/redis-server 
+1
Jun 16 '15 at 10:46
source share

Your connection with redis does not work. Try restarting the redis server, and then start your client again by running the following 3 commands:

 sudo service redis-server restart redis-server redis-cli 
+1
Jan 20 '16 at 13:34
source share

I think maybe you installed redis on the source code. If you need to find redis-source-code-path / utils and run the sudo install_server.sh command. After that, make sure that redis-server is running as a service for your system. sudo service redis-server status

PS: based on Debian / Ubuntu

+1
Apr 25 '16 at 7:07
source share

In the case of Ubuntu, the error is caused by the fact that the redis server is not configured. Install the Redis server again, and then check the status.

If there is no error, a message similar to this appears: -

● redis-server.service - extended storage of key values. Downloaded: uploaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled) Active: active (running) from Wed 2018-01-17 20: 07:27 IST; 16 sec Back Documents: http://redis.io/documentation , man: redis-server (1) Primary PID: 4327 (redis-server) CGroup: /system.slice/redis-server.service 4─4327 / usr / bin / redis-server 127.0.0.1:6379

+1
Jan 17 '18 at 14:46
source share

You must first install the Redis server;

You can install the Redis server on Mac by following the next step -

$ curl -O http://download.redis.io/redis-stable.tar.gz

$ tar xzvf redis-stable.tar.gz

$ cd redis-stable

$ make

$ make test

$ sudo make install

Redis server

Good luck.

+1
Sep 09 '18 at 6:32
source share

Try updating the node version to the latest version.

 sudo npm cache clean -f sudo npm install -gn sudo n stable 

version 0.4 may not work correctly.

-5
Aug 7 '13 at 8:38 on
source share



All Articles