How does one upgrade to a newer version of Redis with zero downtime? Redis slaves are read-only, so it seems like you'd have to take down the master and your site would be read-only for 45 seconds or more while you waited for it to reload the DB.
Is there a way around this?
Sentinel is a system used to manage redis servers , it monitors the redis master and slaves continuously, and whenever a master goes down it will automatically promote a slave in to master. and when the old master is UP it will be made as slave of the new master.
Redis uses asynchronous replication, with asynchronous replica-to-master acknowledges of the amount of data processed. A master can have multiple replicas. Replicas are able to accept connections from other replicas.
Failover is the fault tolerance mechanism provided by Redis cluster, and one of the most core functions of the cluster. Failover supports two modes: Failure failover: Availability of an automatic recovery cluster. Artificial failover: Operable and maintainable operation of a support cluster.
You can deploy as many masters as you want, with any number of slaves each, but they will behave like a single separated cluster with their own memory space, and it will be your responsibility at the application layer to spread your keys properly using each of the masters, just as you would do in a Memcached multi-node ...
Redis Team has very good documentation on this
Core Steps:
Full Documentation:
Upgrading or restarting a Redis instance without downtime
When taking the node offline, promote the slave to master using the SLAVEOF command, then when you bring it back online you set it up as a slave and it will copy all data from the online node.
You may also need to make sure your client can handle changed/missing master nodes appropriately.
If you want to get really fancy, you can set up your client to promote a slave if it detects an error writing to the master.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With