我在这里看过类似的问题,但我想不出我的问题。我的烧瓶应用程序,当部署在heroku上时,并没有连接到我的heroku实例。相反,在我的heroku日志中,我得到了:
2018-05-10T20:36:12.520794+00:00 heroku[web.1]: Starting process with command `flask db upgrade; flask translate compile; gunicorn microblog:app`
2018-05-10T20:36:12.705812+00:00 heroku[worker.1]: Starting process with command `rq worker microblog-tasks`
2018-05-10T20:36:13.385204+00:00 heroku[worker.1]: State changed from starting to up
2018-05-10T20:36:15.060614+00:00 heroku[worker.1]: Process exited with status 1
2018-05-10T20:36:15.080485+00:00 heroku[worker.1]: State changed from up to crashed
2018-05-10T20:36:14.989923+00:00 app[worker.1]: Error 111 connecting to localhost:6379. Connection refused.为什么我的员工如此坚决地连接到本地的redis服务器?我的文件是:
web: flask db upgrade; flask translate compile; gunicorn microblog:app
worker: rq worker microblog-tasks运行"heroku config:get REDIS_URL“显示,env REDIS_URL确实是在heroku中设置的。背景任务需要多个dyno吗?我没有问题,我的应用程序在本地,只是部署在heroku。
单独但相关的问题: redis、redistogo和rediscloud之间有什么区别?什么时候才能使用其中的每一个?真的很感谢你的帮助。
发布于 2018-05-14 23:02:23
实际上,我的文章中有一个遗漏,我对此表示歉意。
启动RQ工作者的命令需要包含Redis的连接URL:
worker: rq worker -u $REDIS_URL microblog-taskshttps://stackoverflow.com/questions/50281528
复制相似问题