I'm doing a proof-of-concept setup on Redis with master/slave and sentinel setup for high availability using StackExchange.Redis and am having some issues with using StackExchange.Redis.
I have successfully setup 3 Ubuntu VMs with the latest Redis server, one server is Master with Sentinel, one is Slave with Sentinel and the other is purely Sentinel. By using the CLI I can see that replication from master to slave is working correctly and when I stop the master (sudo services redis_6379 stop) the slave is promoted to master.
However, when trying to use the StackExchange.Redis
ConnectionMultiplexer redis;
ConfigurationOptions options = ConfigurationOptions.Parse("172.20.74.40:6379,172.20.74.41:6379");
options.AbortOnConnectFail = false;
redis = ConnectionMultiplexer.Connect(options);
I find that this works perfectly when both servers are up, but when the master is taken down Sentinel responds correctly, the slave is promoted to master, but the connection from the app to the cluster takes between 12 and 40 seconds to connect for every attempt (i.e. it never gets faster).
Am I missing something here? I'm trying to achieve high availability but this lag is clear not acceptable for this.
StackExchange.Redis does not support Sentinel. There's a big discussion about it on this Github issue.
In a nutshell: StackExchange doesn't use Sentinel. There was no use case for them to build support for it.
Here you can see Marc Gravell describing how it works with multiple endpoints.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With