Closed sdarwin closed 11 years ago
when a client detects a problem (more or less than 1 master in the cluster) it calls the prototype.failover
method, which attempts to lock all the redis servers by writing a time-sensitive key to them pointing to the client's id. this way multiple clients will (in theory) not try to elect a new master at the same time. the clients that are waiting also listen on a gossip pub/sub channel, and will switch to the new master right after it gets elected by the client that got the lock.
Let's say you have a single redis cluster on the back-end with 3 redis servers. On the front-end there are 10 web servers which are clients of that redis cluster. They all use haredis.
Series of events: