2 Answers
- Newest
- Most votes
- Most comments
1
You can't restore a Redis backup (.rdb) file containing multiple databases to an ElastiCache (cluster mode enabled) cluster. This is by design - "Redis Cluster does not support multiple databases like the standalone version of Redis. We only support database 0; the SELECT command is not allowed" - Redis Cluster Spec
If you wish to move a a cluster running multiple databases to a Cluster Mode Enabled (CME) or Serverless ElastiCache, then it is recommended to modify the Keyspace to migrate data from all the databases to one single database (db0). If you wish to migrate multiple keys with a single call use the MIGRATE command. You can also use MOVE command if only a few keys need to be moved between databases.
answered 10 months ago
0
- To migrate from the existing Redis instance with multiple databases to ElastiCache Redis in cluster mode, here are the steps:
- Take a backup of the existing Redis instance using the `redis-cli command. This will create an RDB file containing data from all databases.
- Launch a new ElastiCache Redis cluster in cluster mode. The cluster should have sufficient number of nodes based on your data size.
- Restore the RDB backup file into database 0 of one of the nodes. This will populate the cluster with data.
- Modify your application code to use the new ElastiCache cluster endpoint and handle sharding of keys across nodes. You may need to restructure your data if keys were previously partitioned across multiple databases.
- Gradually migrate traffic from the existing Redis instance to the new ElastiCache cluster once validation is complete.
- Delete the existing non-clustered Redis instance once migration is fully complete.
Relevant content
- asked 2 years ago
- asked 8 months ago
- asked a year ago
- asked 10 months ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 9 months ago
- How do I turn on Multi-AZ with automatic failover in my ElastiCache for Redis self-designed cluster?AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 9 months ago
hello,
Thanks for your answer, but the elasticache in cluster mode does not accept to load a dump with multiples databases :
You can't restore from a Redis (cluster mode disabled) cluster to a Redis (cluster mode enabled) cluster if the .rdb file references more than one database. Attempting to do this results in the following error: Error: To restore a snapshot in cluster mode, all keys in the RDB file should reside in DB 0. source : https://repost.aws/knowledge-center/elasticache-restore-cluster-from-s3