我用supervisord配置了celery-worker和celery-beat,除了日志记录中的一些小问题外,两者都运行良好。
这是celery-worker.conf,我将loglevel指定为WARNING
[program:celery-worker]
command=celery -A apps.crawler.celery:app worker --loglevel=WARNING
directory=/home/django/django_project/django_project
user=django
numprocs=1
stdout_logfile=/home/django/django_project/django_project/logs/celery-worker.log
stderr_logfile=/home/django/django_project/django_project/logs/celery-worker.log
autostart=true
autorestart=true
startsecs=10
; Need to wait for currently executing tasks to finish at shutdown.
; Increase this if you have very long running tasks.
stopwaitsecs = 10
; When resorting to send SIGKILL to the program to terminate it
; send SIGKILL to its whole process group instead,
; taking care of its children as well.
killasgroup=true
但是,芹菜工人总是以loglevel = INFO
开始ps -ef |grep celery-worker
django 2422 6909 0 01:13 ? 00:00:03 /usr/bin/python /usr/local/bin/celery -A apps.crawler.celer :app worker --concurrency=1 --loglevel=INFO
django 2427 2422 10 01:13 ? 00:03:04 /usr/bin/python /usr/local/bin/celery -A apps.crawler.celer :app worker --concurrency=1 --loglevel=INFO
如何将loglevel更改为WARNING?
答案 0 :(得分:0)
我遇到了同样的问题,并通过重启supervisord解决了这个问题。 在新配置生效之前,需要重新启动Supervisord。