django与主管一起启动celery守护进程的生产

编程入门 行业动态 更新时间:2024-10-11 07:36:17
本文介绍了django与主管一起启动celery守护进程的生产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经在/etc/supervisor/conf.d/myproject-celery.conf

我的配置文件如下:

[program:celery] command=/var/www/html/project/venv/bin/python /var/www/html/project/manage.py celeryd --loglevel=INFO environment=PYTHONPATH=/var/www/html/project directory=/var/www/html/project user=www-data numprocs=1 stdout_logfile=/var/log/celeryd.log stderr_logfile=/var/log/celeryd.log autostart=true autorestart=true startsecs=10 stopwaitsecs = 600 priority=998

在我的产品中,我想开始做芹菜.为此,我正在

Here in my productin I want to start celery. For that I am doing

supervisord -c /etc/supervisor/conf.d/myproject-celery.conf

我这样做的时候说

Error: .ini file does not include supervisord section

这是什么问题?

推荐答案

好像您在配置文件中缺少[supervisord]部分,但这很可能是因为您没有加载主conf文件

Looks like you are missing you [supervisord] section in your config file, but that is likely because you are not loading the main conf file

请参见文档

您不应使用-c和conf.d文件启动 supervisord -该文件夹中的文件通常会自动加载.通常, -c 保留给在普通目录以外的其他地方创建的conf时使用.

You should not start supervisord with -c and a conf.d file - the files in that folder are usually loaded automatically. Usually, the -c is reserved for when your have a conf you created elsewhere other than the normal directory.

如果在没有-c的情况下启动超级用户,它将加载您的/etc/supervisor/supervisor.conf 文件

If you start supervisord without a -c, it should load your /etc/supervisor/supervisor.conf file

您的conf文件应如下所示:

Your conf file should look something like this:

; supervisor config file [unix_http_server] file=/var/run/supervisor.sock ; (the path to the socket file) chmod=0700 ; sockef file mode (default 0700) [supervisord] logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) ; the below section must remain in the config file for RPC ; (supervisorctl/web interface) to work, additional interfaces may be ; added by defining them in separate rpcinterface: sections [rpcinterface:supervisor] supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface [supervisorctl] serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket ; The [include] section can just contain the "files" setting. This ; setting can list multiple files (separated by whitespace or ; newlines). It can also contain wildcards. The filenames are ; interpreted as relative to this file. Included files *cannot* ; include files themselves. [include] files = /etc/supervisor/conf.d/*.conf

如您所见,它会自动将conf.d文件夹中的所有conf文件加载

as you can see it automatically loads all the conf files in your conf.d folder

更多推荐

django与主管一起启动celery守护进程的生产

本文发布于:2023-11-27 11:36:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637896.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:进程   django   celery

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!