Announcement Announcement Module
Collapse
No announcement yet.
How to connect to multiple Redis instances using RedisTemplate Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to connect to multiple Redis instances using RedisTemplate

    Hi,

    I have a few questions:

    1. If I setup 2 Redis servers with sharding, how do I instruct the client using RedisTemplate to connect to both of them?
    2. Does Jedis have the knowladge of the sharing (i.e. to know to which server it should go to get the data?)

    Thanks,

    Yair

  • #2
    Currently, there's no dedicated support for sharding in Spring Redis. We'll probably look into it for 1.1. These being said, most "drivers" should handle this automatically based on your configuration - however take this with a grain of salt as I haven't looked too closely into it.

    Comment


    • #3
      I see that Jedis itself does support a list of ShardInfo objects. I see no other choice other than using it directly?

      What do you mean by "drivers" the spring factory only allows a single host-port pair, right?

      When is version 1.1 planned?

      Thanks,

      Yair

      Comment


      • #4
        By drivers I mean Jedis, Jredis, RJC and so on. The host/port pair can be either a direct connection or maybe a list of shards. It seems the former is the case, even with the drivers.
        If I recall correctly, there is work underway to improve this in Redis itself so the entire sharding process can be dealt with on the redis instance rather then client - however I don't know the specific details.
        1.1 is planned for later this year - we'll have first to reach 1.0 before committing to an actual date.

        Comment

        Working...
        X