Restoring redis cluster snapshot rdb files on new setup

690 views
Skip to first unread message

banjara

unread,
Jul 13, 2017, 5:27:51 AM7/13/17
to Redis DB
Hi
tl;dr
I have a redis cluster and I frequently take rdb dumps. Now I want to build a replica redis cluster on different set of nodes(different IP addresses) using these rdb files. Assume no TCP connectivity between old cluster and new cluster.
Please suggest me how can I achieve it.

Detailed problem:
I want to run redis cluster on kubernetes. I have tried redis cluster with persistent storage using Kuberneter statefulset and Kubernetes deployment but on cluster reboot a new set of IP addresses are assigned to my pods and they are not able to form cluster again. I have tried using kubernetes services with static ip and using hostname but redis internally stores pod IP and on reboot they are not able to form custer.
So, I am thinking about deleting node.conf file on reboot, create fresh cluster and restore rdb files. But I couldn't find any good reference for it. I found some good documents for redis cluster restore in Elastic Cache but they are specific to aws.
Has someone tried redis cluster on kuernetes with cluster reboot resiliency?
Is there any better way of restoring cluster without forming a new cluster in case of IP address change?

Link to my redis cluster using Kubernetes deployment configs: https://github.com/zuxqoj/kubernetes-redis-cluster/blob/master/README-using-deployment.md
Link to my redis cluster using Kubernetes statefulset configs: https://github.com/zuxqoj/kubernetes-redis-cluster/blob/master/README-using-statefulset.md

Thanks.

andyh

unread,
Jul 14, 2017, 2:39:34 AM7/14/17
to redi...@googlegroups.com
Hi

I don't think there is a better way. If you check node.conf, Redis uses IP addr to communicate with peers. Therefore deleting node.conf and restoring Redis state by using AOF files or RDB files is the only way to restore the Cluster in case of IP address change.

I am not a Kubernetes expert. But I guess you can build a "service discovery" client combining Kubernetes events. That client is able to catch the events happened in Kubernetes and update the addresses of Redis services and your applications always connect to this "service discovery" system. 

Andy

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.



--
andyh
Andy Huang (Huangkejun)
Reply all
Reply to author
Forward
0 new messages