当前位置:网站首页>Windows环境Redis使用AOF持久化,无法生成AOF文件,生成后无法加载AOF文件内容
Windows环境Redis使用AOF持久化,无法生成AOF文件,生成后无法加载AOF文件内容
2022-06-28 05:35:00 【六六的小帅】
文章目录
内容有点儿多,请读者仔细阅读完,肯定会解决您的问题
Redis服务推荐的系统环境
- 推荐使用Linux环境作为Redis服务的载体
- 例如使用Centos可以避免一些奇怪的Bug,而且Redis的官方版本Linux环境下的要比Windows环境下的高,肯定就解决了很多已经存在的问题,开发了更多新功能,新特性
- 但是本篇文章内容是用Windows环境作为载体,解决在Windows环境下出现的问题
Redis的官方下载地址
Windows版本下载地址:https://github.com/tporadowski/redis/releases

Linux版本下载地址:https://redis.io/

Redis配置AOF持久化
- 在 redis.windows.conf 文件中打开AOF,如下图,将 “appendonly” 修改为yes


- 完成上述步骤就已经配置好了Redis的AOF持久化
- 但是问题也随之而来了,
双击redis-server.exe并不会生成AOF文件,这是有一种解决方案,是再双击打开redis-cli.exe执行如下命令
// 命令一
config set appendonly yes
// 命令二
config set save “”
- 执行完成上述命令后,确实生成了AOF的持久化文件
appendonly.aof, 如下图
- 但是采用这种方式生成的AOF文件,是无法正常使用的,当我们向Redis中存入内容,再杀掉Redis进程,重新获取刚存入的 key 会得到 null 值,所以采用这种方式是不完全正确的
Redis使用AOF的正确打开方式
我们不应该
鼠标直接双击redis-server.exe文件打开Redis服务应该在
命令提示符下使用命令redis-server.exe redis.windows.conf启动Redis
通过上述方式会成功的生成AOF文件,并且使用Redis的AOF数据持久化功能
Redis在Windows环境下使用“命令启动”和“鼠标双击启动”的区别
双击启动时,Redis只会读取和还原RDB文件还原数据

使用命令行的方式,如果配置了AOF会成功的读取AOF持久化文件

append only 说明是AOF数据持久化文件
边栏推荐
- 数据仓库:金融/银行业主题层划分方案
- Typescript base type
- Shutter nestedscrollview sliding folding head pull-down refresh effect
- Why does the company choose cloud database? What is its charm!
- Camera Basics
- 猿粉猿动力-开发者活动袭!
- Concurrent wait/notify description
- 数据中台:一篇带你深入浅出了解数据中台
- 【JVM】——JVM中内存划分
- How to do a good job of dam safety monitoring
猜你喜欢
![[JVM] - memory partition in JVM](/img/d8/29a5dc0ff61e35d73f48effb858770.png)
[JVM] - memory partition in JVM

Wedding studio portal applet based on wechat applet

Mysql-16-subquery

独立站卖家都在用的五大电子邮件营销技巧,你知道吗?

Qtcanpool knowledge 07:ribbon

Sharing | intelligent environmental protection - ecological civilization informatization solution (PDF attached)

Gee learning notes 3- export table data

Deeplearning ai-week1-quiz

Lhasa accordion

線條動畫
随机推荐
猿粉猿动力-开发者活动袭!
Application of Beidou No.3 short message terminal in dam safety monitoring scheme
Yunda's cloud based business in Taiwan construction 𞓜 practical school
JSP connecting Oracle to realize login and registration
What is the difference between AC and DC?
[Linux] - using xshell to install MySQL on Linux and realize the deployment of webapp
numpy.reshape, numpy.transpose的理解
1404. number of steps to reduce binary representation to 1
中小型水库大坝安全自动监测系统解决方案
FB、WhatsApp群发消息在2022年到底有多热门?
What does mysql---where 1=1 mean
Linked list in JS (including leetcode examples) < continuous update ~>
jq图片放大器
小球弹弹乐
8VC Venture Cup 2017 - Elimination Round D. PolandBall and Polygon
数据仓库:DWS层设计原则
TypeScript基础类型
The heading angle of sliceplane is the same as that of math Corresponding transformation relation of atan2 (y, x)
[JVM] - Division de la mémoire en JVM
Sqlmap tool user manual