[英]How to fix 'Error 111 connecting to localhost:6379. Connection refused' when I start rq-worker?
I'm working with flask, redis and rq-worker in my web application that is hosted ina debian 9 machine.我在托管在 debian 9 机器上的 Web 应用程序中使用烧瓶、redis 和 rq-worker。 When I start rq-worker I get this error: "Error 111 connecting to localhost:6379. Connection refused".
当我启动 rq-worker 时,我收到此错误:“连接到 localhost:6379 的错误 111。连接被拒绝”。
I already checked if Redis was installed and running, I tried these comands:我已经检查了 Redis 是否已安装并正在运行,我尝试了以下命令:
/opt/apps/mywebapp/flask$ ps aux | grep redis
sib 4987 0.0 0.0 12784 976 pts/2 S+ 09:37 0:00 grep redis
redis 6574 0.1 0.0 40860 3512 ? Ssl may28 3:38 /usr/bin/redis-server 127.0.0.1:6379
/opt/apps/mywebapp/flask$ redis-cli ping
PONG
I've read other post and this is an evidence that Redis is running and woking.我读过其他帖子,这是 Redis 正在运行和工作的证据。
I also check the file redis.conf and I set this variable:我还检查了文件 redis.conf 并设置了这个变量:
bind 127.0.0.1
I tried again.我又试了一次。
/opt/apps/mywebapp/flask$ rq worker
But I keep receiving the error.但我一直收到错误。
Error 111 connecting to localhost:6379. Connection refused.
对不起,这是redis配置绑定属性,我设置为127.0.0.1 ::00,但正确的配置是127.0.0.1 ::01。
您必须通过 ipconfig 而不是 localhost 放置您的 Ip
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.