Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I support the Redis sentinel architecture using StackExchange.Redis?

My application uses the StackExchange.Redis package and I started using the sentinel architecture in order to support high availability and failures.

I've search the web, trying to find the correct way I should use the ConnectionMultiplexer object while using the sentinel architecture and couldn't really find a useful answer.

Some posts say that it doesn't support it yet or partially supports it, some tell you to add all your redis connection addresses to the connection string and some tell you that they provided a custom implementation by subscribing to events.

So, does the ConnectionMultiplexer support this kind of architecture?
If the answer is yes, how should my connection string look like?

like image 217
Amir Popovich Avatar asked Nov 10 '16 16:11

Amir Popovich


People also ask

How do I connect to redis Sentinel?

Commands. Use “redis-cli” with port 26379 to connect to sentinel. Note: you always want to tail the /var/log/sentinel/sentinel. log on all sentinels to see the cluster interaction.

What is StackExchange redis?

StackExchange. Redis is a high performance general purpose redis client for . NET languages (C#, etc.). It is the logical successor to BookSleeve, and is the client developed-by (and used-by) Stack Exchange for busy sites like Stack Overflow.

What is redis ConnectionMultiplexer?

Redis is the ConnectionMultiplexer class in the StackExchange. Redis namespace; this is the object that hides away the details of multiple servers. Because the ConnectionMultiplexer does a lot, it is designed to be shared and reused between callers. You should not create a ConnectionMultiplexer per operation.

What is redis C#?

Redis is a NoSQL key-value cache that stores the information in a hash table format, providing the possibilities to store different types of structured data like strings, hashes, lists, sets, sorted sets, bitmaps and hyperloglogs.


1 Answers

You might be looking for this:

https://github.com/StackExchange/StackExchange.Redis/pull/406

like image 130
NotHere Avatar answered Sep 23 '22 17:09

NotHere