I'm migrating an application from a single server to a Kubernetes cluster.
I'm no really sure what's the best option to migrate the Redis service, therefore I'd like to get the advice of anyone :)
I have deployed the Spotahome redis operator and create a RedisFailover
.
The Master/Slave Redis is working fine, but is empty, so I need to figure out what's the most secured way to import the data without any loss.
What I tried
I found the REPLICAOF command which is exactly what I need, but the issue that Sentinel reverts the config after a moment.
I'm afraid that this happen while syncing the data and therefore have a partial import.
Another idea
Backup/restore in Redis is nothing else than copying the dump.rdb
file so I was thinking to shutdown the pods in Kubernetes, shutdown the old Redis instance, copy the dump.rdb
file in the pod's volumes, and starting again the pod.
So now
- Do you see any other way to achieve what I'm trying to do?
- Is copying the
dump.rdb
file the best option?