最近,我在一个Laravel项目上安装了Horizon,该项目运行在一个上。
我的问题是,排队的工人没有得到任何工作。我没有主管:
vagrant@homestead:~/Code/project$ artisan horizon:list
+----------------+------+-------------+---------+
| Name | PID | Supervisors | Status |
+----------------+------+-------------+---------+
| homestead-D2dV | 7094 | None | running |
+----------------+------+-------------+---------+
vagrant@homestead:~/Code/project$ artisan horizon:supervisors
No supervisors are running.以下是我的主管(horizon.conf)配置:
[program:horizon]
process_name=%(program_name)s
command=/usr/bin/php /home/vagrant/Code/project/artisan horizon
autostart=true
autorestart=true
user=vagrant
redirect_stderr=true
stdout_logfile=/home/vagrant/Code/project/storage/logs/horizon.log当我打开这台机器时,我的日志和web界面表明"Horizon成功启动了.“。
以及我的视界(horizon.php)配置:
'environments' => [
'production' => [
'supervisor-1' => [
'connection' => 'redis',
'queue' => ['default', 'queue-1', 'queue-2', 'queue-3'],
'balance' => 'auto',
'processes' => env('HORIZON_PROCESSES', 10),
'tries' => 3,
],
],
'local' => [
'supervisor-1' => [
'connection' => 'redis',
'queue' => ['default', 'queue-1', 'queue-2', 'queue-3'],
'balance' => 'auto',
'processes' => env('HORIZON_PROCESSES', 3),
'tries' => 3,
],
],
],我的上司似乎也很活跃:
vagrant@homestead:~/Code/project$ sudo service supervisor status
● supervisor.service - Supervisor process control system for UNIX
Loaded: loaded (/lib/systemd/system/supervisor.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2018-03-28 13:03:08 UTC; 6h ago
Docs: http://supervisord.org
Process: 1591 ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown (code=exited, status=0/SUCCESS)
Main PID: 2547 (supervisord)
Tasks: 2
Memory: 34.4M
CPU: 21.038s
CGroup: /system.slice/supervisor.service
├─2547 /usr/bin/python /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
└─7094 /usr/bin/php /home/vagrant/Code/project/artisan horizon
Mar 28 18:32:13 homestead supervisord[2547]: 2018-03-28 18:32:13,225 INFO spawned: 'horizon' with pid 7057
Mar 28 18:32:15 homestead supervisord[2547]: 2018-03-28 18:32:15,055 INFO success: horizon entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Mar 28 18:32:16 homestead php[7057]: DIGEST-MD5 common mech free
Mar 28 18:32:16 homestead supervisord[2547]: 2018-03-28 18:32:16,693 INFO exited: horizon (exit status 0; expected)
Mar 28 18:32:17 homestead supervisord[2547]: 2018-03-28 18:32:17,706 INFO spawned: 'horizon' with pid 7072
Mar 28 18:32:19 homestead supervisord[2547]: 2018-03-28 18:32:19,584 INFO success: horizon entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Mar 28 18:32:26 homestead php[7072]: DIGEST-MD5 common mech free
Mar 28 18:32:26 homestead supervisord[2547]: 2018-03-28 18:32:26,206 INFO exited: horizon (exit status 0; expected)
Mar 28 18:32:27 homestead supervisord[2547]: 2018-03-28 18:32:27,210 INFO spawned: 'horizon' with pid 7094
Mar 28 18:32:29 homestead supervisord[2547]: 2018-03-28 18:32:29,052 INFO success: horizon entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)对于我的上司为什么不工作有什么想法或想法吗?
发布于 2018-03-28 21:05:50
事实证明,我的horizon.php配置是错误的。
我改变了这句话:
'local' => [ ...以匹配我的APP_ENV环境变量;该变量设置为development。
https://stackoverflow.com/questions/49542349
复制相似问题