Search code examples
ruby-on-railsruby-on-rails-4redissidekiq

Redis ReadOnly You can't write against ready only slave


I am using Redis and Sidekiq for delayed emails and an asynchronous process in a Rails 4 app. My prod environment has 2 severs. Server 1 runs Redis-master and sidekiq and Server 2 runs Redis-slave and sidekiq. I am getting an error "readonly you can't write against a read only slave". How do I configured sidekiq on server 2 to use the Redis-master on server 1? Thx.


Solution

  • See here from Sidekiq's documentation - edit config/initializers/sidekiq.rb and throw into it the url of the master, e.g. redis://redis.example.com:7372.