Unable to fetch data from multiple redis instances

October 30, 2014 939 views

I have successfully installed twemproxy and I can easily set data in redis through twemproxy , but when I have tried to fetch data from server it always take from 1st one from list which I mentioned in yml file .so how to fetch data from other server as well ? can you help me?

1 Answer

Could you describe what you are trying to accomplish in a bit more detail? Is the cluster being used as a data store or for caching? It would likely help us answer you better.

twemproxy will partition your data, splitting it among multiple Redis instances. If you are trying to fetch the same key from Redis through twemproxy repeatedly it will come from the same node. This article from the Redis documentation is a good explanation of partitioning.

  • Thanx for response .....

    I have used for redis caching purpose , my data are goes properly in multiple nodes but when I tried to pull data from nodes it will always fetch from 1st node in list and data in 2nd node it shows me empty cache (nil) , my configuration is

    hash: fnv1a64
    tag: "{}"
    distribution: ketama
    autoejecthosts: true
    timeout: 400
    redis: true
    server_connections: 2

    • server1
    • server2

    Please help me .

Have another answer? Share your knowledge.