Redis (1.14) Redis daily management and maintenance

[1] endurance of

[1.1] RDB persistence

  RDB persistent data generation process to save the current snapshot (.rdb) files to the hard disk of the process. And a manual trigger automatic trigger

  (1) manual trigger (save and bgsave)

    save: blocking the current redis, know RDB persisted until the process is complete, if memory instances relatively long blockage caused by the General Assembly. Line is not recommended.

    bgsave: redis process execution fork operation to create a child thread, the child thread completed persistence, blocking time is very short (microsecond).

        It is optimized save in execution redis-cli when shutdown services redis shut, if not open AOF persistence, automatic execution bgsave;

  (2) RDB file

# Parameters 
config the SET dir / usr / local # Set rdb file path 

# backup
bgsave # dump.rdb to save the file to the directory dir parameter

# restore
the dump.rdb redis installation directory into the same directory with redis.conf restart redis to

# advantages:
binary 1. after compression is applied to backup, restore the full amount for disaster recovery
2. load RDB to recover data much faster than the AOF way
# drawback
1. persistence can not be done in real time, every time create a child process, frequently operating costs are too high
2. binary file is saved, there is the old version is not compatible with the new version rdb file problem

  (3) RDB configuration

 

 

  

Guess you like

Origin www.cnblogs.com/gered/p/11836516.html
Recommended