【问题标题】:Celery is constantly starting with supervisor芹菜不断从主管开始
【发布时间】:2018-03-27 16:13:28
【问题描述】:

如何在 Supervisor 中运行 celery? 这是我的 .conf 文件:

[program:celery_worker]
command=celery -A urlextractor worker -l info
process_name=%(program_name)s ; process_name expr
numprocs=1
directory=/home/omuntean/Django/urlextractor /urlextractor ; directory to cwd to before exec (def no cwd)
autostart=true ; start at supervisord start (default: true)
autorestart=unexpected ; when to restart if exited after running
user=root
stopasgroup=true
stopsignal=QUIT
stdout_logfile=/var/log/urlextractor/celery_w_out.log
stderr_logfile=/var/log/urlextractor/celery_w_err.log

如果我正常运行 celery 命令,它可以正常工作,没有任何错误,但是,当我键入时:

sudo 服务主管启动

然后查看状态:

supervisorctl 状态

它给了我:

celery_worker RUNNING pid 10651,正常运行时间 0:00:02

urlextractor RUNNING pid 9761,正常运行时间 0:08:08

然后在我再次输入后它给了我:

celery_worker 开始

urlextractor RUNNING pid 9761,正常运行时间 0:08:09

为什么会发生这种情况,我怎样才能让它发挥作用?

【问题讨论】:

  • 你检查过日志文件吗?
  • 是的,里面什么都没写。
  • 尝试使用 -n 选项在前台启动 supervisord,也许你可以看到会发生什么。
  • 由于日志文件条目中的空间,可能会发生这种情况。
  • 当我运行 supervisord -n 时,它告诉我 celery_worker 正在退出并进入运行状态。

标签: python django celery supervisord


【解决方案1】:

我发现了问题。它的用户。我的设置为root。除非强制,否则 Celery 不允许通过 root 激活。我只需要更改用户。

【讨论】:

    猜你喜欢
    • 2013-10-04
    • 2015-07-04
    • 2021-08-22
    • 1970-01-01
    • 1970-01-01
    • 2012-11-13
    • 2023-03-02
    • 2019-02-10
    • 2021-09-23
    相关资源
    最近更新 更多