Loading...

Lỗi supervisor running nhưng RabbitMQ ở trạng thái idle


Hiện tại mình đang dùng MacOS, lỗi này sẽ thường gặp cho anh em nào đang dùng laravel

Setup supervisor để xử lý queue.

Supervisor thì running nhưng queue thì cử ở trạng thái idle không xử lý.





Setup ban đầu của mình 

[program:queue-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /Users/tinhnguyen/Sites/laravel/src/artisan queue:work rabbitmq --queue=order_hook_queue
numprocs=8
startsecs=0
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile= /Users/tinhnguyen/Sites/laravel/src/storage/logs/worker.log


Cơ bản thì copy dòng này chạy terminal thì nó vẫn ok

php /Users/tinhnguyen/Sites/laravel/src/artisan queue:work rabbitmq --queue=order_hook_queue


- Nhưng khi worker run thì thường sẽ lỗi bash của php

Cách khắc khục đơn giản là

Ở terminal

tinhnguyen $ which php

/usr/local/opt/php@7.4/bin/php


Sau giờ copy lại bash của php là ok.

[program:queue-worker]
process_name=%(program_name)s_%(process_num)02d
command=/usr/local/opt/php@7.4/bin/php /Users/tinhnguyen/Sites/laravel/src/artisan queue:work rabbitmq --queue=order_hook_queue
numprocs=8
startsecs=0
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile= /Users/tinhnguyen/Sites/laravel/src/storage/logs/worker.log



Note: Đây là cách setup dưới local cho anh em đang dùng macos, còn lên môi trường production có thể khác.

Chúc anh/em cấu hình chạy ngon lành



6 COMMENT

admin

admin

11/Aug/2021 23:58

Thứ 4, 11/08 tên miền .FUN giá 1K | .com 188k | .net 169k | .xyz, .online, .website 9k | .vn -100% tặng .shop 0đ

admin

admin

30/Jul/2021 15:38
Thứ 6, 30/07 tên miền .ONLINE giá 1K
admin

admin

29/Jul/2021 09:14
Thứ 5, 29/07 tên miền .FUN giá 1K
admin

admin

28/Jul/2021 09:59
Thứ 4, 28/07 tên miền .PW giá 1K
admin

admin

27/Jul/2021 13:15
Thứ 3 27/07 tên miền .WEBSITE giá 1K
admin

admin

26/Jul/2021 13:35
Mở đầu tuần mới cùng tên miền .ASIA 1K

# Bài viết cùng chuyên mục