39

How to completely disable RDB and AOF? I don't care about Persistence and want it to be in mem only.

I have already commented out the:

#save 900 1
#save 300 10
#save 60 10000

But this did not help and I see that Redis still tries to write to disk. I know that Redis wants to write to disk because I get this error: "Failed opening .rdb for saving: Permission denied"

I don't care about the error, because I want to disable the Persistence altogether.

d-_-b
  • 21,536
  • 40
  • 150
  • 256
realPro
  • 1,713
  • 3
  • 22
  • 34

2 Answers2

108

If you want to change the redis that is running, log into the redis, and

disable the aof:

config set appendonly no

disable the rdb:

config set save ""

If you want to make these changes effective after restarting redis, using

config rewrite

to make these changes to redis conf file.

If your redis have not started, just make some changes to redis.conf,

appendonly no
save ""

make sure there are no sentences like "save 60 1000" after the upper sentences, since the latter would rewrite the former.

fibonacci
  • 2,254
  • 2
  • 17
  • 13
  • 2
    For me, even after doing this the persistance was there always. So, I manually deleted appendonly.aof and dump.rdb I restarted the redis-server, now the persistence is not happening. – Nigilan Aug 23 '17 at 09:16
  • 2
    This happened for me also. I disabled writing by commenting out all save lines. However, a dump.rdb file still existed in /var/lib/redis. Every time the redis server started this outdated file was read. Removing the file solved this, of course. – Jorrit Schippers Jun 21 '19 at 09:54
  • When using Redis cluster with Sentinel removing `*rdb` files is a must if you still can see see: rdb_bgsave_in_progress: 1 – Невен Иванов Sep 10 '21 at 06:33
6

Update: please look at Fibonacci's answer. Mine is wrong, although it was accepted.


Commenting the "dbfilename" line in redis.conf should do the trick.

Pascal Le Merrer
  • 5,883
  • 20
  • 35