Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My redis server "crashed" and I lost all my data because it's all in memory?

I realize that all my data is gone when I log in... KEYS * shows nothing.

Luckily, I'm doing this in dev server.

What am I supposed to do if this happens in the future on production?

Am I supposed to back it up every second?

like image 479
user847495 Avatar asked Dec 21 '11 05:12

user847495


1 Answers

You can find a number of answers/options here:

http://redis.io/topics/persistence

From what I could gather, you should:

  1. Configure your server instance to periodically persist its data to file every 5 minutes or so. That way at most you will lose a few minutes of data if the server goes down.
  2. Configure your server instance to write an AOF redo log (append-only-file). You have various options to favor durability or performance.
  3. Add at least one additional server and use that for replication. That way you will only ever lose any data if both/all of the servers go down simultaneously.
like image 119
aroth Avatar answered Oct 03 '22 03:10

aroth