Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Redis backup recovery

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Note: [to restore, simply move the backup files to the redis installation directory, restart the service, if it is RDB persistence, just move dump.rdb to the installation directory, if it is aof persistence, just move appendonly.aof to the installation directory, if it is RDB+AOF persistence, move dump.rdb and appendonly.aof at the same time] Redis data backup and recovery

The Redis SAVE command is used to create a backup of the current database.

Grammar

The basic syntax for redis Save commands is as follows:

Redis 127.0.0.1 redis 6379 > SAVE instance redis 127.0.0.1 redis 6379 > SAVE OKBgsave create redis backup files can also be created using the command BGSAVE, which is executed in the background. Instance 127.0.0.1 6379 > BGSAVEBackground saving started

This command creates the dump.rdb file in the redis installation directory.

Recover data

If you need to restore data, simply move the backup files (dump.rdb and appendonly.aof) to the redis installation directory and start the service. You can use the CONFIG command to get the redis directory, as follows:

Redis 127.0.0.1 dir 6379 > CONFIG GET dir1) "dir" 2) "/ usr/local/redis/bin"

The redis installation directory output from the above command CONFIG GET dir is / usr/local/redis/bin.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report