Celery 与 Django - 部署
我正在考虑在我的项目中使用芹菜。我找到了很多有关如何使用它等的信息。我感兴趣的是如何部署/打包我的解决方案。
我需要运行两个组件 - django 应用程序和 celeryd worker(发送电子邮件的组件)。例如,我希望我的 django 应用程序使用 email_ticket 任务来通过电子邮件发送支持票证。我在 django 应用程序中创建tasks.py。
@task
def email_ticket(from, message):
...
我是否部署 django 应用程序,然后将 celeryd 作为来自同一路径的单独进程运行?
./manage.py celeryd ...
不同服务器上的工作人员怎么办?部署整个 django 应用程序并仅运行 celeryd?我知道我只能将 celery 用于工作人员,但我想使用 celerycam 和 celerybeat。
如有任何反馈,我们将不胜感激。谢谢
感谢您的任何反馈。
I am considering using celery in my project. I found a lot of information about how to use it etc. What I am interested in is how to deploy/package my solution.
I need to run two components - django app and then celeryd worker (component that sends emails). For example I would like my django app to use email_ticket task that would email support tickets. I create tasks.py in the django app.
@task
def email_ticket(from, message):
...
Do I deploy my django app and then just run celeryd as separate process from the same path?
./manage.py celeryd ...
What about workers on different servers? Deploy whole django application and run only celeryd? I understand I could use celery only for the worker, but I would like to use celerycam and celerybeat.
Any feedback is appreciated. Thanks
Thanks for any feedback.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此处文档对此进行了介绍。要点是您需要下载一些初始化脚本并设置一些配置。一旦完成,celeryd 将在启动时启动,您就可以开始运行了。
This is covered in the documentation here. The gist is you need to download some init scripts and setup some config. Once that's done celeryd will start on boot and you'll be off and running.