carlos8f / haredis

High-availability redis in Node.js.
https://npmjs.org/package/haredis
154 stars 21 forks source link

Periodically changing of master #6

Closed Rolandvl closed 11 years ago

Rolandvl commented 11 years ago

Hi,

(typically, when I wanted to add new cluster, but don't want to stop previous server while the new one is not ready)

Thanks.

carlos8f commented 11 years ago
  1. what do you see in the log? haredis will trigger failover if the master connection breaks, which can happen in various cases like a temporary network outage. In theory, this is nothing to worry about and your app will carry on as if nothing happened.
  2. looks like there's no problem with that, haredis will find (or elect) a master in each group of nodes, and the clients will function independently.
  3. this would only pose a problem if r4:p4 is/becomes master. in that case, the first client doesn't know about the master node, and would attempt to elect a master within its known pool. then, if the first client elects a new master that isn't part of the second client's pool, you'd run into an infinite failover loop. So having clients with different configs might work for a short time (while you restart your servers) but it would be safer to shut down the old configs before bringing up the new ones. And for sure, don't run conflicting configurations for an extended period to avoid infinite failover loops.

Cheers, Carlos