2

shoryuken gem 是从 aws SQS 读取的 Rails 应用程序的后台工作程序。

我可以在当地运行 shoryuken 工人,它工作正常。当我在 AWS 的生产环境中运行它时,它不起作用。如何在生产环境中运行 shoryuken?我还认为这可能是我的 aws 安全组的问题。我们正在使用 VPC。我应该允许 SQS 端口吗?如果是这样,SQS 运行在哪个端口?我也想知道为什么它询问端口 5432,这是我们 Postgres DB 的端口。

bundle exec shoryuken -r path_to_my_worker.rb -C config/shoryuken.yml --rails RAILS_ENV=production

could not connect to server: Connection refused
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?
4

2 回答 2

3

尝试通过RAILS_ENV=production之前shoryuken。如果你之后通过它,它将无法正常工作。

RAILS_ENV=production bundle exec shoryuken -r path_to_my_worker.rb -C config/shoryuken.yml --rails
于 2016-01-02T15:04:28.333 回答
0

事实证明,shoryuken 正在将我的开发环境加载到 aws 中。当我在 database.yml 中将我的设置从生产复制到开发时,它起作用了。这似乎不对。我不知道如何传递命令使其在生产模式下运行。我已经尝试过“RAILS_ENV=production”和“-e production”,对升龙拳没有影响。

于 2015-10-23T02:35:38.153 回答