Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED

后端 未结 17 1972
时光说笑
时光说笑 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 16:05

    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.

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

    for Windows users, you can use chocolatey to install Redis

    choco install redis-64
    

    then run server from

    C:\ProgramData\chocolatey\lib\redis-64\redis-server.exe
    
    0 讨论(0)
  • 2020-12-12 16:06

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

    Then run...

        $ wget https://github.com/antirez/redis/archive/5.0.5.tar.gz <- change this to whatever Redis version you want (https://github.com/antirez/redis/releases)
        $ tar xzf redis-5.0.5.tar.gz
        $ cd redis-5.0.5
        $ make
    
    0 讨论(0)
  • 2020-12-12 16:06

    In case of ubuntu, the error is due to redis-server not being set up. Install the redis-server again and then check for the status.

    If there is no error, then a message like this would be displayed :-

    ● redis-server.service - Advanced key-value store Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2018-01-17 20:07:27 IST; 16s ago Docs: http://redis.io/documentation, man:redis-server(1) Main PID: 4327 (redis-server) CGroup: /system.slice/redis-server.service └─4327 /usr/bin/redis-server 127.0.0.1:6379

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

    Install redis on your system first -

    brew install redis
    

    then start the redis server -

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