redis persistence operation 1

Persistence
    1. redis is an in-memory database, when redis server restart, restart the computer acquisition, data will be lost, we can redis data memory persistence saved to the hard disk file.
    2. redis persistence mechanisms:
   1. a RDB: default, do not need to be configured to use this mechanism default
    * in a certain time interval, the detection of the change key, and persistent data
    1. Edit redis.windwos. conf file
      # After 900 sec (15 min) IF AT Least. 1 Key changed
      Save 900. 1
      # After 300 sec (. 5 min) IF AT Least 10 Keys changed
      Save 300 10
      # After 60 sec IF AT Least 10000 Keys changed
      Save 60 10000

     2 restart redis server, and specify the configuration file name
      D: \ redis-2.8.9> redis-server.exe redis.windows.conf

   2. AOF of: logging mode, you can record the operation of each command. Each operation command may, persistent data
    1. File Edit redis.windwos.conf
      appendonly no (off aof) -> appendonly yes (opening AOF)

      # Appendfsync always: Each time operations are carried out persistent
      appendfsync everysec: once every second persistence
      # appendfsync no: not for persistence

Guess you like

Origin www.cnblogs.com/naigai/p/11938422.html