[Redis Snippet] How to convert redis rdb to redis aof

Redis logo

Redis rdb is so damn fast, it maximizes Redis performances (http://redis.io/topics/persistence), but it’s so much i/o pain.

Redis aof is great for persistence, and easily integrate with redis cluster (not release yet).

So, why I want to move from rdb to aof?
1. My datasets is large (look at my post) and changing every time
2. When some data added to redis in rdb mode, and save, the i/o is very high (based on snapshot in redis.conf file)
3. I really don’t want the i/o very high
4. I can lose my data when redis down while save process is not complete, I don’t want this happened
5. Save process in rdb mode is took so long time for me

Maybe somebody want to do this, so here is how to do it :
1. start your redis server in rdb mode using default redis.conf
2. So, your redis dump is dump.rdb (default), maybe you want to change this, no problem
3. Edit your redis.conf and uncomment appendfilename mydump.aof
4. Go to console, then go to redis-cli and type BGREWRITEAOF
5. Or if you do want to go to redis console, just type redis-cli bgrewriteaof
6. Then redis will fork new redis process, check this with top command
7. When it’s done, you have aof file.


One thought on “[Redis Snippet] How to convert redis rdb to redis aof

  1. […] So my last post is how to convert redis rdb to aof […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s