Error 111 connecting to localhost:6379. Connection refused. Django Heroku

后端 未结 12 1166
感动是毒
感动是毒 2020-12-28 12:33

I am able to run redis locally and everything works.

However when I deploy to heroku I get this error:

Error 111 connecting to localhost:6379. Conn         


        
12条回答
  •  暖寄归人
    2020-12-28 13:16

    This could happen when whatever application that is calling/connecting to redis, the environment variable it consumed in order to specify a connection hasn't been properly set - REDISCLOUD_URL or REDISTOGO_URL etc. This could most easily be that redis was started after the app or redis restarted and cycled its connection IP and/or access. So, upon deploying, insure redis is started prior to the downstream app(s)

    Insure redis is up and running and a simple reboot on the app could fix the issue OR, as other answers have indicated, refresh the app in the appropriate manner to re-fresh & re-consume the environment variable.

提交回复
热议问题