I want to get notificated when a master changes
For this i wanted to connect to my sentinels but the connection Multiplexer tells me that the are not reachable.
What am I Doing wrong?
ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("localhost:26380,localhost:26381,localhost:26382");
You can try the (much) newer version of StackExchange.Redis which comes with sentinel mode feature. You can now connect in sentinel mode with connection string like this:
var conn = ConnectionMultiplexer.Connect("172.17.6.45:26379,serviceName=mymaster");
It will auto-discover current master and return a managed connection which will handle the failover for you. If you want to be notified for master change you can subscribe the ConnectionMultiplexer.ConfigurationChanged
event.
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