How to disable persistence with redis?

后端 未结 4 663
闹比i
闹比i 2021-01-30 03:06

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 sens

4条回答
  •  渐次进展
    2021-01-30 03:24

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

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

      appendonly no
      
    2. Disable RDB snapshotting by commenting all of the save configuration directives (there are 3 that are defined by default)

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

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

    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).

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

提交回复
热议问题