【发布时间】:2013-11-08 20:57:34
【问题描述】:
我刚开始将AWS Elastic Beanstalk 与我的rails 应用程序一起使用,我需要将Resque gem 用于后台作业。然而,尽管努力搜索如何在 Elastic Beanstalk 上运行 Resque 工作程序,我还是无法弄清楚如何?
How can I run Rails background jobs with Resque on AWS Elastic Beanstalk? 谈到在 Elastic Beanstalk 容器中将它们作为服务运行,但是仍然很混乱。
这是我的 ebextentions resque.config 文件:
services:
sysvinit:
resque_worker:
enabled: true
ensureRunning: true
commands:
resque_starter:
rake resque:work QUEUE='*'
编辑 现在我的 resque.config 文件如下所示:
container_commands:
resque_starter: "rake resque:work QUEUE='*'"
services:
sysvinit:
resque_worker:
enabled: true
ensureRunning: true
commands:
resque_starter
它仍然无法正常工作。 编辑 2
container_commands:
resque_starter:
command: "rake resque:work QUEUE=sqs_message_sender_queue"
cwd: /var/app/current/
ignoreErrors: true
仍然显示 0 个工人。
【问题讨论】:
-
我建议使用 container_commands 而不是命令。
-
令我困惑的是如何在每次部署后自动运行“rake resque:work QUEUE='*'”命令,如果它是活着的,杀死并重新运行?我希望它更具体
-
@Omer,你知道如何在 EB 上持久化 Resque 工作人员吗?
标签: ruby-on-rails amazon-web-services resque amazon-elastic-beanstalk