Day11JavaWeb [Redis] Redis persistence

REdis persistence-RDB

  • (1) Redis persistence
    is to save Redis data from memory to the hard disk. After
    persistence, a dump.rdb file will be generated in the decompressed folder, and the data in your memory will be saved in this file
    Insert picture description here

    • (2) What is RDB persistence? (Key point)
      Specify the frequency to persist Redis data.
      Redis supports this method by default. You don’t need to do anything. Redis will automatically store the memory data to the hard disk
      save 900 1 //900 seconds Within, if the value of at least one key changes, Redis will automatically persist
      save 300 10 //within 300 seconds, if at least 10 key values ​​have changed, Redis will automatically persist
      save 60 10000 // within 60 seconds , If the value of at least 10,000 keys changes, Redis will automatically persist
      Insert picture description here

Redis persistence-AOF (understand)

  • (1) AOF persistence (understand)
    》》What is AOF and
    immediately persist to disk every operation.
    This mechanism can bring higher data security, that is, data persistence
  • 》》 Redis does not support this method by default
    1) So we need to modify the configuration file to allow Redis to support
    2) Modify the configuration file:
    392: appendonly no Change no to yes
    3) Restart the server and
    cannot directly double-click: redis-server.exe instead Open the startup.bat script file (manually specify the configuration file)
    4) Redis will automatically generate a file in the unzipped folder: appendonly.aof file
    5) By default, AOF is
    appendfsync everysec every second.
    Insert picture description here

Guess you like

Origin blog.csdn.net/u013621398/article/details/108704904