Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable Redis RDB and AOF?

Tags:

redis

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.

like image 862
realPro Avatar asked Dec 28 '14 22:12

realPro


People also ask

How do I disable Redis?

If you started the Redis server using the redis-server command, you could stop the Redis server by pressing CTRL + C.

What is AOF and RDB in Redis?

RDB (Redis Database): The RDB persistence performs point-in-time snapshots of your dataset at specified intervals. AOF (Append Only File): The AOF persistence logs every write operation received by the server, that will be played again at server startup, reconstructing the original dataset.

What is aof Redis?

Redis Append Only File or AOF is a persistence mechanism that allows the Redis server to keep track and log every command executed on the server. These command logs can then be re-played when the server starts up, recreating the database to its original state.


2 Answers

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.

like image 110
fibonacci Avatar answered Sep 20 '22 17:09

fibonacci


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.

like image 20
Pascal Le Merrer Avatar answered Sep 24 '22 17:09

Pascal Le Merrer