简体   繁体   English

Supervisord在配置文件中混淆了两个程序

[英]Supervisord get confused two programs in configuration file

I have two laravel 5.1 aplications that uses beanstalkd and supervisord to manage queue jobs. 我有两个laravel 5.1使用aplications beanstalkdsupervisord管理队列的作业。

The supervisord.conf file has the two programs defined as administratord.conf文件将两个程序定义为

[program:diagbovespa-default-queue]
command=php artisan queue:listen --tries=2 --env=aceite
process_name=%(program_name)s_%(process_num)02d
directory=/sciere/sites/diagbovespa.aceite.pro.br
numprocs=2
user=apache
redirect_stderr=true
autostart=true
autorestart=true
stdout_logfile=/sciere/sites/diagbovespa.aceite.pro.br/storage/logs/queue_supervisord.log

[program:questionarioise-default-queue]
command=php artisan queue:listen --tries=2 --env=aceite
process_name=%(program_name)s_%(process_num)02d
directory=/sciere/sites/questionarioise.aceite.pro.br
numprocs=2
user=apache
redirect_stderr=true
autostart=true
autorestart=true
stdout_logfile=/sciere/sites/questionarioise.aceite.pro.br/storage/logs/queue_supervisord.log

The queue.php file for diagbovespa application has beanstalkd defined as diagbovespa应用程序的queue.php文件已beanstalkd定义为

    'beanstalkd' => [
        'driver' => 'beanstalkd',
        'host'   => 'localhost',
        'queue'  => 'default',
        'ttr'    => 60,
    ],

and the queue.php questionarioise application has beanstalkd defined as queue.php questionarioise应用程序已beanstalkd定义为

    'beanstalkd' => [
        'driver' => 'beanstalkd',
        'host'   => 'localhost',
        'queue'  => 'questionarioise',
        'ttr'    => 60,
    ],

So beanstalkd consider two queue groups, default and questionarioise . 因此,beanstalkd考虑了两个队列组: defaultquestionarioise

The problem is that when I send an email via laravel default queue (program:diagbovespa-default-queue), sometimes I receive email from diagbovespa , sometiems from questionarioise . 问题是,当我通过laravel默认队列(程序:diagbovespa-default-queue)发送电子邮件时,有时我会收到来自diagbovespa电子邮件,有些来自questionarioise

What I'm missing in supervisord and/or beanstalkd configuration? 我在supervisord和/或beanstalkd配置中缺少什么?

Your queue workers don't have a queue name specified, so they'll pick up any jobs with any queue label. 您的队列工作者没有指定队列名称,因此他们将选择带有任何队列标签的所有作业。

In your configs you have 'queue' => 'default' and 'queue' => 'questionarioise' . 在您的配置中,您有'queue' => 'default''queue' => 'questionarioise' You need to update your queue workers to listen and handle those jobs only: 您需要更新队列工作器以仅侦听和处理这些作业:

[program:diagbovespa-default-queue]
command=php artisan queue:listen --tries=2 --env=aceite --queue=default

And: 和:

[program:questionarioise-default-queue]
command=php artisan queue:listen --tries=2 --env=aceite --queue= questionarioise

Though I'd suggest changing the first queue name from default to something more specific like diagbovespa , and use that in supervisord as well. 尽管我建议将第一个队列名称从default更改为更具体的名称,例如diagbovespa ,并在supervisor中也使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM