I may have missed it, but I wasn't aware that you could configure it to read from the slaves? However, this is my master + 2 slave configuration:
config.cache_store = :redis_store, {
url: 'redis://prestwick/1',
sentinels: [{host: 'prestwick.i', port: 26379}, {host: 'carnoustie.i', port: 26379}, {host: 'birkdale.i', port: 26379}],
role: 'master',
expires_in: 1.hour
}
And in case it's useful, my configuration for a generic REDIS object and Sidekiq (this is in config/initializers/001_redis.rb):
redis_options = {
url: 'redis://prestwick/0',
sentinels: [{host: 'prestwick.i', port: 26379}, {host: 'carnoustie.i', port: 26379}, {host: 'birkdale.i', port: 26379}],
role: 'master'
}
redis_sidekiq_options = {
url: 'redis://prestwick/2',
sentinels: [{host: 'prestwick.i', port: 26379}, {host: 'carnoustie.i', port: 26379}, {host: 'birkdale.i', port: 26379}],
role: 'master'
}
REDIS = Redis.new(redis_options)
Sidekiq.configure_server do |config|
config.redis = redis_sidekiq_options
end
Sidekiq.configure_client do |config|
config.redis = redis_sidekiq_options
end