How to disable Redis RDB?

2019-02-01 08:02发布

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.

标签: redis
2条回答
冷血范
2楼-- · 2019-02-01 08:30

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.

查看更多
Emotional °昔
3楼-- · 2019-02-01 08:39

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.

查看更多
登录 后发表回答