I'm testing a new Redis cluster (AWS Large primary/slave nodes) in AWS Elasticache Redis.
How can I backup or export my data from the Redis cluster?
Other hosted redis services automatically create a Redis RDB dump file and store it on S3. I would like to do something similar with ElastiCache.
EDIT: New AWS Feature as of 4/24/2014
Amazon has added internal backup support as of 4/24. This allows you to snapshot redis data daily and restore it to an ElastiCache cluster. It does not allow exporting/downloading at the present. The solution below is still required if you want to keep your own archives/backups of redis data.
Most people should be able to use the built in backup system now available.
Original Answer
It looks like the only way to do this is to do the following.
SAVE
command to generate a local dumpdump.rdb
on S3I'd love a simpler solution or something built into ElastiCache.
EDIT: Elaboration
I ended up actually building this using the Ruby gem/utility "redis-backup" (https://github.com/josegonzalez/ruby-redis-backup) with a crontab running the following shell command:
sudo -u redis /usr/bin/env S3_SAVE=true redis-backup -s /var/lib/redis/dump.rdb -B YOUR_S3_BUCKET_FOR_BACKUPS -A S3_ACCESS_KEY_ID -S S3_ACCESS_SECRET_KEY
It doesn't look like this is possible anymore. According to the AWS docs,
"Beginning with Redis 2.8.22, ElastiCache no longer supports external read replicas."
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