当前位置:网站首页>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数据持久化文件
边栏推荐
- [leetcode] 12. Integer to Roman numeral
- Docker installs mysql5.7 and starts binlog
- Solution of dam safety automatic monitoring system for medium and small reservoirs
- numpy. reshape, numpy. Understanding of transfer
- What is the difference between AC and DC?
- 数据仓库:DWS层设计原则
- Function reentry caused by Keil C51's data overlaying mechanism
- Based on the order flow tool, what can we see?
- How to develop the language pack in the one-to-one video chat source code
- Why is point shield cloud forced to quit playing?
猜你喜欢
随机推荐
When using the MessageBox of class toplevel, a problem pops up in the window.
指定默认参数值 仍报错:error: the following arguments are required:
Line animation
原动力×云原生正发声 降本增效大讲堂
Cryptography notes
电商转化率这么抽象,到底是个啥?
开发者的时代红利在哪里?
MySQL export database dictionary to excel file
JSP connects with Oracle to realize login and registration (simple)
联想混合云Lenovo xCloud,新企业IT服务门户
codeforces每日5题(均1700)
CSCI GA scheduling design
拉萨手风琴
msa.h:没有那个文件或目录
线条动画
Wedding studio portal applet based on wechat applet
Shutter nestedscrollview sliding folding head pull-down refresh effect
Zzuli:1072 frog climbing well
Rxswift -- (1) create a project
【LeetCode】12、整数转罗马数字