美文网首页
python配置自动启动程序,例子:celery

python配置自动启动程序,例子:celery

作者: Aedda | 来源:发表于2021-08-25 11:30 被阅读0次

使用 supervisord

安装 supervisord

pip install supervisor
echo_supervisord_conf> supervisord.conf # 生成配置文件,这个配置文件要放在django的根路径下

编辑 supervisord.conf 文件,在最后添加下面内容

···········

[program:celeryd]
command=celery -A test_project worker -P eventlet --loglevel=INFO --concurrency=15
stdout_logfile=/var/log/celery/celeryd.log
stderr_logfile=/var/log/celery/celeryd.log
autostart=true
autorestart=true
startsecs=10

启动supervisord
supervisord

成功启动后,查看日志文件

相关文章

网友评论

      本文标题:python配置自动启动程序,例子:celery

      本文链接:https://www.haomeiwen.com/subject/ezpsiltx.html