Redis Cluster Backups

1,198 views
Skip to first unread message

Daniel Alonso Heras

unread,
Nov 6, 2015, 4:36:26 AM11/6/15
to Redis DB
Hi!!

We are thinking about using Redis Cluster in production. But before trying to fit it in roadmap we would like to know how some things works (we haven't find them on documenteation):

  - Backups in Redis Cluster. How is this performed? Globally? master by master? could be done in a slave?

  - Could a external redis be connected as a slave of a single node of the cluster? If so could be a way to achieve backups without loosing performance (monitoring masters and slaves with cluster slots to keep all ok)

Thanks in advance

The Baldguy

unread,
Nov 6, 2015, 3:43:25 PM11/6/15
to Redis DB


On Friday, November 6, 2015 at 3:36:26 AM UTC-6, Daniel Alonso Heras wrote:
Hi!!

We are thinking about using Redis Cluster in production. But before trying to fit it in roadmap we would like to know how some things works (we haven't find them on documenteation):

  - Backups in Redis Cluster. How is this performed? Globally? master by master? could be done in a slave?

You'll have to do it on a per-master/slave basis. Essentially you back up each Redis master the way you normally back up a Redis master.

 
  - Could a external redis be connected as a slave of a single node of the cluster? If so could be a way to achieve backups without loosing performance (monitoring masters and slaves with cluster slots to keep all ok)

No, it can't. As the spec indicates Redis Cluster divides the data across multiple nodes. No single server knows all the data, so you can't have a single slave to it.


While the above sound simple enough, and it is for backing it up, restoring is different. If there have been no topology changes you should be able to drop the RDB file in place and start up. If, however, the topology has change, and particularly that some keys have moved, the behavior is not the same.  I believe, though I'd hope to wrong, that scenario's behavior is unspecified.

Cheers,
Bill

chilumb...@gmail.com

unread,
Nov 8, 2015, 10:24:45 PM11/8/15
to Redis DB
Like Bill said, you have to back up each master independently since they all contain different data. And to make a backup, you can just save the rdb dump file. And restoration also includes just replacing the current dump (remove it if it exists) file with the backup dump file.

Ideally, you want the system config for all the nodes in the redis cluster to be the same. It would not make much sense to have nodes in the cluster having varying system configurations e.g memory and disk size, somaxconn, tcp_max_syn_backlog, file-max, hardware, OS, redis versions etc. 

Daniel Alonso Heras

unread,
Nov 10, 2015, 3:19:21 AM11/10/15
to Redis DB
Hi all!!

Thank you very much for your help!!

By the way, regarding this:


  - Could a external redis be connected as a slave of a single node of the cluster? If so could be a way to achieve backups without loosing performance (monitoring masters and slaves with cluster slots to keep all ok)

No, it can't. As the spec indicates Redis Cluster divides the data across multiple nodes. No single server knows all the data, so you can't have a single slave to it.

What I meant is to have several slaves connected, each one to each data slot group of the cluster (for example: three masters --> three slaves out of the cluster) and connect and disconnect them just when backup is needed, based on our own backups policy.
 
Thanks in advance!!

Daniel Alonso Heras

unread,
Nov 19, 2015, 8:42:15 AM11/19/15
to Redis DB
Does anybody know if it is possible to do this of if there is a better way??

BR
Reply all
Reply to author
Forward
0 new messages