当前位置:网站首页>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数据持久化文件
边栏推荐
- 【JVM】——JVM中內存劃分
- Detailed usage configuration of the shutter textbutton, overview of the shutter buttonstyle style and Practice
- [C language practice - printing hollow square and its deformation]
- 密码学笔记
- Blog login box
- OpenSSL client programming: SSL session failure caused by an obscure function
- codeforces每日5题(均1700)
- Steve Jobs' speech at Stanford University -- follow your heart
- Operation of 2022 power cable judgment question simulation examination platform
- Error: the following arguments are required:
猜你喜欢

Solution of dam safety automatic monitoring system for medium and small reservoirs

Animation de ligne

博客登录框

如何在您的Shopify商店中添加实时聊天功能?

Shanghai Yuge ASR CAT1 4G module 2-way low power 4G application

jsp连接Oracle实现登录注册

? How to write the position to output true

【JVM】——JVM中內存劃分
![[JVM] - Division de la mémoire en JVM](/img/d8/29a5dc0ff61e35d73f48effb858770.png)
[JVM] - Division de la mémoire en JVM

What does mysql---where 1=1 mean
随机推荐
Jdbc的使用
Why don't big manufacturers use undefined
What is the difference between AC and DC?
Qcom LCD commissioning
什么是WebRTC?
msa.h:没有那个文件或目录
猿粉猿动力-开发者活动袭!
Yin Yang master page
OpenSSL client programming: SSL session failure caused by an obscure function
gorm事务体验
电商转化率这么抽象,到底是个啥?
【C语言练习——打印空心正方形及其变形】
Concurrent wait/notify description
ERP软件公司选型的重要根据
Shanghai Yuge ASR CAT1 4G module 2-way low power 4G application
How to learn programmable logic controller (PLC)?
File foundation - read / write, storage
Keil C51的Data Overlaying机制导致的函数重入问题
codeforces每日5题(均1700)
解决ValueError: Iterable over raw text documents expected, string object received.