How To Backup AWS Elasticache Redis Data?
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.
- Spin up new EC2 instance
- Install Redis
- Configure local replica attached to ElastiCache redis primary
- Wait for data to sync locally
- Issue a redis
SAVE
command to generate a local dump - Archive local
dump.rdb
on S3
I'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."