我根据celery文档页面中给出的celery supervisor配置示例设置了主管。但是,看起来工人没有正确启动。这是配置:
[program:celery-1]
command=celery worker -A tasks.user -l DEBUG -n userworker1 -Q user_works
directory=/home/myuser/projects/myproc
user=root
numprocs=1
stdout_logfile=/var/log/supervisor/userworker1.log
stderr_logfile=/var/log/supervisor/userworker1.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 = 600
; 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
; if rabbitmq is supervised, set its priority higher
; so it starts first
priority=998
我检查了userworker1.log,发现在启动过程中没有显示任务。
但是,如果我在命令终端中运行它。如下:
celery worker -A tasks.user -l INFO -n userworker1 -Q user_works
我看到了
-------------- celery@userworker1 v3.1.11 (Cipater)
---- **** -----
--- * *** * -- Linux-3.5.0-23-generic-x86_64-with-Ubuntu-12.04-precise
-- * - **** ---
- ** ---------- [config]
- ** ---------- .> app: tasks:0x394ea50
- ** ---------- .> transport: amqp://guest@localhost:5672//
- ** ---------- .> results: disabled
- *** --- * --- .> concurrency: 4 (prefork)
-- ******* ----
--- ***** ----- [queues]
-------------- .> user_works exchange=user_works(direct) key=user_works
[tasks]
. user.finduser
. user.refreshuser
. user.updateuser
有关celeryd.conf的错误的任何想法吗?