Home >Database >Redis >How to recover redis downtime data

How to recover redis downtime data

(*-*)浩
(*-*)浩Original
2019-11-28 09:35:052492browse

How to recover redis downtime data

Redis data is placed in memory. If the machine goes down, the data in the memory will not exist.

Need to be persisted, the data in the memory is saved on the disk, and the data can be restored to the memory the next time it is started. (Recommended learning: Redis Video Tutorial)

AOF append only file (all redis operation commands are recorded in the aof file), restore the data and execute it again.

Features: Save every second, the data is relatively complete, and it consumes performance.

Disadvantages: The data generated between 0-1 seconds is lost and cannot be saved. However, the save mode can be modified to generate an AOF every time redis is changed

AOF opening settings:

Modify the redis.conf file as shown below:

Set appendonly to yes

How to recover redis downtime data

Redis can enable AOF, use AOF to restore data, the data exists in the /usr/local/redis/bin/appendonly.aof file

More Redis related technical articles , please visit the Redis Getting Started Tutorial column to learn!

The above is the detailed content of How to recover redis downtime data. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How is redis persisted?Next article:How is redis persisted?