I have a Redis cluster of 4 nodes, 1 master and 3 slaves, monitored by Sentinel.
Now in rails I need to connect to this cluster, reading from the nearest replica, and writing to the master, the same as I do with MongoDB.
Using the redis-rails
gem, how is it possible to configure the cache_store
to specify the Sentinels instead of a single node?
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:
And in case it's useful, my configuration for a generic REDIS object and Sidekiq (this is in config/initializers/001_redis.rb):