I am looking for an example of jedis using the redis sentinel. I am not able to use the jedis facilities for sentinel, and I could not find any good example or documentation.
相关问题
- Getting Redis Master address from Sentinel C#
- How to provide Sentinel value at the end of Struct
- Configuring Redis to play nice with AppHarbor
- Why do we need Redis for running CKAN?
- Problem in deserialize redis-cache to objects in S
The Jedis library is an awesome solution, unfortunately with bad documentation.
So,
As I am using Spring, I need:
Here's an example when you aren't using Spring and need a simple connection via Jedis to a Redis master/slave set managed by Redis sentinels
Source: This blog post on connecting to Redis Sentinels.
Have you tried Redisson? It offer sentinel automatic master/slave/sentinel discovery and topology update and you don't need to handle with connections, data encoding... it's all done by Redisson. Here is the code example: