Sidekiq在生产环境中启动无法正常工作?

时间:2019-03-11 18:24:14

标签: ruby-on-rails amazon-ec2 sidekiq redis-server

在开发模式下执行命令时,使用以下命令可以正常工作

捆绑执行程序sidekiq -C config / sidekiq.yml

但是当我添加生产标记以及以下命令之类的命令

捆绑执行程序sidekiq -e生产-C config / sidekiq.yml

Sidekiq无法启动,并且出现如下所示的长错误消息

/home/ubuntu/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/home/ubuntu/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/cli.rb:27:in `dispatch'
/home/ubuntu/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/home/ubuntu/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/cli.rb:18:in `start'
/home/ubuntu/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/exe/bundle:30:in `block in <top (required)>'
/home/ubuntu/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/home/ubuntu/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/exe/bundle:22:in `<top (required)>'
/home/ubuntu/.rbenv/versions/2.5.3/bin/bundle:23:in `load'
/home/ubuntu/.rbenv/versions/2.5.3/bin/bundle:23:in `<main>'
/home/ubuntu/.rbenv/versions/2.5.3/bin/ruby_executable_hooks:24:in `eval'
/home/ubuntu/.rbenv/versions/2.5.3/bin/ruby_executable_hooks:24:in `<main>'

我正在具有ubuntu 18.4操作系统版本的AWS-EC2实例上运行这些命令。

文件config / sidekiq.yml-

的内容
:verbose: false
:concurrency: 10
:pidfile: tmp/pids/sidekiq.pid
:queues:
  - [critical, 2]
  - default
  - low

production:
  :concurrency: 25


staging:
  :concurrency: 15

文件config / initialzers / sidekiq.rb的内容

Sidekiq.configure_server do |config|
    config.redis = { url: 'redis://127.0.0.1:6379' }
  end

  Sidekiq.configure_client do |config|
    config.redis = { url: 'redis://127.0.0.1:6379' }
  end

文件config / redis.yml的内容

development: 'redis://127.0.0.1:6379'
test: 'redis://127.0.0.1:6379'
production: 'redis://127.0.0.1:6379'

0 个答案:

没有答案