我的 sidekiq.yml 文件如下:
:verbose: false
:pidfile: ./tmp/pids/sidekiq.pid
:logfile: ./log/sidekiq.log # 输出的日志地址
:queues:
- [phoenix_job,7]
- [default, 2] # 写在队列参数中的, 表示让 sidekiq 处理这个 queue
staging:
:concurrency: 5
development:
:concurrency: 5
production:
:concurrency: 50
初始化 sidekiq 和 redis 的文件 sidekiq.rb 的文件如下:
instance = Redis.new(
{ :host => "#{ENV['REDIS_SERVER_ADDRESS']}",
:port => ENV['REDIS_SERVER_PORT'],
:db => 0,
:password => "#{ENV['REDIS_PASSWORD']}",
:driver => :hiredis
})
Sidekiq.configure_server do |config|
config.redis = Redis::Namespace.new("kalading/#{Rails.env}", redis: instance, :namespace => "sidekiq_redis")
end
现在执行:bundle exec sidekiq -C config/sidekiq.yml报如下错误 redis 也尝试重启了几次,就是不知道问题出在了哪里,新手第一次用求解