【问题标题】:Multiple celerycam procceses on the same server同一服务器上的多个 celery cam 进程
【发布时间】:2013-09-01 06:37:55
【问题描述】:

我有两个 celerycam 进程配置为在主管下运行。这是我的 supervisord.conf 的一部分:

[program:dev1_celerycam]    
directory = /var/www/dev1.example.com
command = /usr/bin/python2.7 /var/www/dev1.example.com/manage.py celerycam --logfile=/var/log/supervisor/dev1_celerycam.log --workdir=/var/www/dev1.example.com
stderr_logfile = /var/log/supervisor/dev1_celerycam_error.log
stdout_logfile = /var/log/supervisor/dev1_celerycam.log
exitcodes=0,2
priority=993

[program:dev_celerycam]    
directory = /var/www/dev.example.com
command = /usr/bin/python2.7 /var/www/dev.example.com/manage.py celerycam --logfile=/var/log/supervisor/dev_celerycam.log --workdir=/var/www/dev.example.com
stderr_logfile = /var/log/supervisor/dev_celerycam_error.log
stdout_logfile = /var/log/supervisor/dev_celerycam.log
exitcodes=0,2
priority=995

另外我在 supervisord.conf 中有两个 celeryd 进程。他们在同一台服务器上启动得非常好。但是对于 celerycam 进程之一,我在 supervisord.log 中获得了下一个:

2013-09-01 09:35:12,546 INFO exited: dev_celerycam (exit status 1; not expected)
2013-09-01 09:35:12,546 INFO received SIGCLD indicating a child quit
2013-09-01 09:35:15,555 INFO spawned: 'dev_celerycam' with pid 25504
2013-09-01 09:35:16,540 INFO exited: dev_celerycam (exit status 1; not expected)
2013-09-01 09:35:16,540 INFO received SIGCLD indicating a child quit
2013-09-01 09:35:17,542 INFO gave up: dev_celerycam entered FATAL state, too many start retries too quickly

dev_celerycam 或 dev1_celerycam 在 supervisord 重新启动时会发生这种情况。其中一个开始正常,而另一个失败。看起来是随机发生的。

有没有机会让两个 celerycam 进程都工作?

【问题讨论】:

    标签: celery django-celery


    【解决方案1】:

    两个 celerycam 进程以某种方式在同一路径中创建了 pid 文件。必须为每个 celerycam 进程添加 --pidfile 参数。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-12-09
      • 2012-12-05
      • 1970-01-01
      • 2010-12-05
      • 1970-01-01
      • 2013-05-03
      • 2019-11-21
      • 1970-01-01
      相关资源
      最近更新 更多