如何禁用Redis RDB和AOF? [英] How to disable Redis RDB and AOF?

查看:42
本文介绍了如何禁用Redis RDB和AOF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何彻底禁用RDB和AOF?我不关心持久性,只希望它在内存中.

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

我已经注释掉了:

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

但这并没有帮助,我看到 Redis 仍在尝试写入磁盘.我知道 Redis 想要写入磁盘,因为我收到此错误:无法打开 .rdb 进行保存:权限被拒绝"

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,登录redis,然后

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

禁用 aof:

config set appendonly no

禁用 rdb:

config set save ""

如果要在重启redis后使这些更改生效,使用

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

config rewrite

对 redis conf 文件进行这些更改.

to make these changes to redis conf file.

如果你的redis还没有启动,只需对redis.conf做一些修改,

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

appendonly no
save ""

确保上面的句子后面没有像save 60 1000"这样的句子,因为后者会重写前者.

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

这篇关于如何禁用Redis RDB和AOF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆