如何禁用redis的持久性? [英] How to disable persistence with redis?

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

问题描述

我想知道如何禁用 redis 中的存在.这里提到了这样做的可能性:http://redis.io/topics/persistence.我的意思与那里描述的完全相同.任何帮助将不胜感激!

I was wondering how to disable presistence in redis. There is mention of the possibility of doing this here: http://redis.io/topics/persistence. I mean it in the exact same sense as described there. Any help would be very much appreciated!

推荐答案

要在 Redis 中禁用所有数据持久性,请在 redis.conf 文件中执行以下操作:

To disable all data persistence in Redis do the following in the redis.conf file:

  1. 通过将 appendonly 配置指令设置为 no(这是默认值)来禁用 AOF.像这样:

  1. Disable AOF by setting the appendonly configuration directive to no (it is the default value). like this:

appendonly no

  • 通过注释所有 save 配置指令(默认定义了 3 个)并明确禁用保存来禁用 RDB 快照:

  • Disable RDB snapshotting by commenting all of the save configuration directives (there are 3 that are defined by default) and explicitly disabling saving:

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

  • 更改后,请确保重新启动 Redis 以应用它们.

    After change, make sure you restart Redis to apply them.

    或者,您可以使用 CONFIG SET 命令来在运行时应用这些更改(只需确保您还执行了 CONFIG REWRITE 以保持更改).

    Alternatively, you can use the CONFIG SET command to apply these changes during runtime (just make sure you also do a CONFIG REWRITE to persist the changes).

    注意:根据您的 Redis 版本,还有其他一些调整可防止 Redis 访问磁盘以执行与复制相关的任务.

    Note: depending on your Redis' version, there are other tweaks that prevent Redis from accessing the disk for replication-related tasks.

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

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