How to disable Redis RDB and AOF?
Asked Answered
B

2

40

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.

Birthmark answered 28/12, 2014 at 22:51 Comment(2)
Could you add some more details about your environment?Metrics
Single box, CentOS 7, Redis 2.8.19Birthmark
S
110

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.

Splinter answered 12/1, 2016 at 6:24 Comment(3)
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.Chrome
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.Rotgut
When using Redis cluster with Sentinel removing *rdb files is a must if you still can see see: rdb_bgsave_in_progress: 1Newcastle
H
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.

Haviland answered 28/12, 2014 at 23:21 Comment(3)
This is not true, commenting that line will only fall back on a default location for that file. @Splinter answer is the correct one.Spinozism
Hats off for redirecting your accepted answer to the actually correct one.Scram
i did take a look at Fibonacci's number, but all it gave me was 13 21 34Elishaelision

© 2022 - 2024 — McMap. All rights reserved.