Redis Cluster - Application Entry Point

66 visualizzazioni
Passa al primo messaggio da leggere

Deepak

da leggere,
19 lug 2016, 13:42:0519/07/16
a Redis DB
I have a python app that uses redis for Data sets, I have been working with a single redis instance in my dev environment. The middleware team is building a redis cluster with 3 masters and 3 slaves, could someone help me understand where should I point my application ? (to one master ? or to multiple masters using a loadbalancer / with some haproxy-redis failover mode ?).

I am new to this and any help would be great.

Tuco

da leggere,
19 lug 2016, 23:49:5019/07/16
a Redis DB
You need to use an appropriate redis client in python, a client which supports cluster...the list is present at http://redis.io/clients#python, something like pyredis should do it, as it seems to support cluster, and just follow how pyredis accepts the ip:ports of redis instances.

Deepak

da leggere,
20 lug 2016, 02:59:5520/07/16
a Redis DB
Great - Thanks for that. Does that mean I have to make changes to the existing application ?

Also are there any simple solution other than clustering which won't require much changes to the app ? I need something that can scale as well !

Deepak

da leggere,
20 lug 2016, 03:00:5220/07/16
a Redis DB
I am confused with how Redis cluster works as well, the documentation is not that great.

Is all the data replicated across all the cluster instances ? (if a master fails - could i just point to another master and will it work like normal ?)

Tuco

da leggere,
20 lug 2016, 03:08:4120/07/16
a Redis DB
For each master node, its data will be replicated by its slave redis node.
If a master is down, and its slave is promoted to be a master by redis, a smart redis client will know that, and will use the new master accordingly. I am not aware of how well the pyredis handles it. We use java which has good smart clients in Jedis and Lettuce.

Deepak

da leggere,
20 lug 2016, 05:56:0720/07/16
a Redis DB
Thank you Tuco.
Rispondi a tutti
Rispondi all'autore
Inoltra
0 nuovi messaggi