带有AWS Elastic Beanstalk的Laravel队列

编程入门 行业动态 更新时间:2024-10-28 19:20:17
本文介绍了带有AWS Elastic Beanstalk的Laravel队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在我的本地服务器上,我可以毫无问题地使用队列,只需使用: php artisan queue:work .

In my local server I can use the queue without problem, just using: php artisan queue:work.

但是在我的AWS服务器中,队列未运行.

But in my server in AWS the queue don't running.

我的连接队列是数据库,同步邮件发送没有问题.

My connection queue is database and sync mails are sending without problem.

我已在Job表中签入,可以看到我的队列,但由于未知原因,它从未运行.

I'd checked in Job table and I can see my queues but for unknown reason it's never running.

是否有必要在AWS Elastic Beanstalke服务器中进行一些不同的配置?

Is necessary to do some different configuration in AWS Elastic Beanstalke server?

我尝试手动使用

php artisan queue:listen php artisan queue:work

都失败了.

推荐答案

要检查的内容:

  • 尝试指定连接名称: php artisan queue:work database

    否则,请确保在这种情况下,EC2上的env文件引用正确的默认QUEUE_DRIVER QUEUE_DRIVER = database

    Else make sure your env file on EC2 refers to correct default QUEUE_DRIVER QUEUE_DRIVER=database in this case

    如果未在环境文件中指定队列驱动程序,请检查config/queue.php的默认设置. default'=>env('QUEUE_DRIVER','database')

    Check config/queue.php for right default settings, if you don't specify queue driver in env file default' => env('QUEUE_DRIVER', 'database')

    在您的EC2实例上运行 php artisan config:cache 以重新加载环境更改.

    Run php artisan config:cache on your EC2 instance for reload the env changes.

    您只需要使用以下2条命令之一,建议使用 php artisan queue:work 作为其缓存应用程序状态的方法,但是每运行一次 php artisan queue:restart 推送代码更改的时间.

    And you only need to use only one of the 2 commands, recommended is php artisan queue:work as its caches application state but run php artisan queue:restart every time you push code changes.

    建议安装和配置主管: laravel/docs/5.8/queues#supervisor-configuration

    It is recommended to install and configure supervisor: laravel/docs/5.8/queues#supervisor-configuration

    它将负责在EC2重新启动或队列故障时重新启动队列工作器

    It will take care of restarting the queue worker on EC2 restart or queue failure

  • 更多推荐

    带有AWS Elastic Beanstalk的Laravel队列

    本文发布于:2023-11-15 07:51:50,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1592542.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:队列   Elastic   AWS   Laravel   Beanstalk

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!