使用supervisor后台运行celery

原因想用celery执行一些爬虫的后续操作,不占用爬虫爬取的时间.尝试了不同的方法感觉supervisor最靠谱,这也是celery官方推荐的做法.

做法:

1 安装 supervisor

pip install supervisor

2 进入项目文件夹,创建 conf 文件

cd project
echo_supervisord_conf> supervisord.conf
结果如下所示

在这里插入图片描述

3 编辑conf文件

使用项目的路径:

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

4 执行命令

supervisord
查看日志输出

在这里插入图片描述

MQ queue 示意图

在这里插入图片描述

完结~
发布了80 篇原创文章 · 获赞 22 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/qq_40244755/article/details/104614739