1.Windows系统Redis重启后数据丢失的处理办法
注意:启动redis服务器是直接进入redis目录下启动redis-server.exe这个文件的,这样的启动方式会导致redis服务器忽略配置文件中的配置(redis.windows.conf)。如果要避免,应该使用cmd到redis文件下,输入redis-server.exe redis.windows.conf来启动。
处理办法:
首先修改配置 : redis.windows.conf 文件,找到appendonly no 改为 appendonly yes,找到appendfsync 设置为 appendfsync everysec。
然后,修改完后保存退出,用cmd打开命令窗口启动redis,输入redis-server.exe redis.windows.conf 来启动。
Redis配置文件参数说明:https://www.cnblogs.com/wenanry/archive/2012/02/26/2368398.html