Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED

后端 未结 17 1971
时光说笑
时光说笑 2020-12-12 15:34

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 = requ         


        
相关标签:
17条回答
  • 2020-12-12 15:56

    I'm on windows, and had to install Redis from here and then run redis-server.exe.

    From the top of this SO question.

    0 讨论(0)
  • 2020-12-12 15:58

    You have to install redis server first;

    You can install redis server on mac by following 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.

    0 讨论(0)
  • 2020-12-12 15:58

    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.

    0 讨论(0)
  • 2020-12-12 15:59

    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

    0 讨论(0)
  • 2020-12-12 16:01

    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
    

    And the output will be: redis-server is running - that means that the problem is solved.

    0 讨论(0)
  • 2020-12-12 16:03

    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

    0 讨论(0)
提交回复
热议问题