【问题标题】:Supervisor running on background but jobs are getting failed immediately主管在后台运行,但作业立即失败
【发布时间】:2015-01-31 16:53:31
【问题描述】:

我已成功为beanstalk 队列设置了supervisor (CentOS release 6.6),它之前可以工作,但在更改密码后突然无法工作。我以root 用户身份进行(设置),但现在每当我在queue 中添加作业时,它都会失败,并且日志文件中提供了以下跟踪:

2014-12-03 00:45:36,017 INFO RPC interface 'supervisor' initialized
2014-12-03 00:45:36,017 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2014-12-03 00:45:36,017 INFO daemonizing the supervisord process
2014-12-03 00:45:36,017 INFO supervisord started with pid 31309
2014-12-03 00:45:37,022 INFO spawned: 'queue' with pid 31317
2014-12-03 00:45:38,023 INFO success: queue entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

目前supervisord.conf 包含以下配置:

[unix_http_server]
file=/tmp/supervisor.sock   ; (the path to the socket file)

[supervisord]
logfile=/tmp/supervisord.log
logfile_maxbytes=50MB
logfile_backups=10
loglevel=info
pidfile=/tmp/supervisord.pid
nodaemon=false
minfds=1024
minprocs=200

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///tmp/supervisor.sock

[program:queue]
command=/usr/local/bin/php artisan queue:listen --tries=3 --timeout=86400 --sleep=60

directory=/home/***/www/*** // Real path removed for this question
autostart=true
autorestart=true
redirect_stderr=true

我已经尽我所能,重新启动program 并重新加载supervisor 几次,但没有运气。我现在该怎么做才能让它再次工作?

更新:如果我从终端手动运行php artisan queue:work,那么它可以在前台运行。

【问题讨论】:

    标签: php queue supervisord beanstalkd laravel-5


    【解决方案1】:

    试试

    $ ps aux | grep artisan  # get artisan PID
    $ sudo kill -2 <PID>
    $ ps aux | grep artisan  # verify artisan has shutdown properly - if not use kill -9 in previous step
    

    有时supervisorctl 在关闭进程时遇到问题。可能是因为进程没有监听 SIGINT/SIGTERM 或者因为进程挂起。在任何一种情况下kill -9 都应该蛮力杀死它,然后你可以使用supervisorctl start program

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-02
      • 1970-01-01
      • 2020-03-10
      相关资源
      最近更新 更多