Home > Database > Redis > body text

How to recover redis downtime data

(*-*)浩
Release: 2019-11-28 09:35:05
Original
2302 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!