解决Redis报错Redis is configured to save RDB snapshots, but it is currently not able to persist on disk
Redis报错信息
在Spring Boot中集成Redis客户之后,进行数据操作,发现报如下错误:
org.springframework.data.redis.RedisSystemException: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:54)at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:52)at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41)at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44)at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42)at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:270)at org.springframework.data.redis.connection.lettuce.LettuceStringCommands.convertLettuceAccessException(LettuceStringCommands.java:799)at org.springframework.data.redis.connection.lettuce.LettuceStringCommands.set(LettuceStringCommands.java:148)at org.springframework.data.redis.connection.DefaultedRedisConnection.set(DefaultedRedisConnection.java:281)at org.springframework.data.redis.core.DefaultValueOperations$3.inRedis(DefaultValueOperations.java:240)at org.springframework.data.redis.core.AbstractOperations$ValueDeserializingRedisCallback.doInRedis(AbstractOperations.java:60)at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:228)at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:188)at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:96)at org.springframework.data.redis.core.DefaultValueOperations.set(DefaultValueOperations.java:236)
报错原因
从Redis层面来分析错误的直接原因是:
Redis被配置为保存数据库快照,但它目前不能持久化到硬盘。用来修改集合数据的命令不能用。请查看Redis日志的详细错误信息。
也就是说,Redis无法将缓存中的数据写入本地磁盘。
针对Redis报错无法写入磁盘,往往有以下原因:
- 磁盘满了
- Redis配置问题
- 操作权限问题
如果磁盘满了,直接清理磁盘或进行扩充即可。
解决方案
问题一
如果是权限问题,查看日志会发现如下日志:
11875:M 06 Mar 2020 09:00:12.034 * 1 changes in 3600 seconds. Saving...
11875:M 06 Mar 2020 09:00:12.035 * Background saving started by pid 12625
12625:C 06 Mar 2020 09:00:12.036 # Failed opening the RDB file dump.rdb (in server root dir /usr/local/redis-5.0.7) for saving: Permission denied
如果是权限问题,则服务对应目录的权限,或在配置文件中修改目标目录到有权限操作的目录。
默认目录配置如下:
# The filename where to dump the DB
dbfilename dump.rdb# The working directory.
#
# The DB will be written inside this directory, with the filename specified
# above using the 'dbfilename' configuration directive.
#
# The Append Only File will also be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
dir ./
修改下面的dir路径:
dir /Users/zzs/tools/dbs
然后重启即可。在重启的过程中可能依然由于无法保存数据而死循环,此时就需要杀手锏了。
问题二
如果是配置问题导致,则可进行如下修改。
使用redis-cli连接上redis,然后执行如下命令:
config set stop-writes-on-bgsave-error no
通过将stop-writes-on-bgsave-error设置为no来进行解决。但这种方案治标不治本,从根本上来讲,还是需要大家查看后台异常原因,进行有针对性的解决。
原文链接:《解决Redis报错Redis is configured to save RDB snapshots, but it is currently not able to persist on disk.》
精品SpringBoot 2.x视频教程
《Spring Boot 2.x 视频教程全家桶》,精品Spring Boot 2.x视频教程,打造一套最全的Spring Boot 2.x视频教程。
程序新视界
公众号“程序新视界”,一个让你软实力、硬技术同步提升的平台
解决Redis报错Redis is configured to save RDB snapshots, but it is currently not able to persist on disk相关推荐
- 解决redis报错:Redis is configured to save RDB snapshots, but it is currently not able to persist on disk
1.问题描述 操作redis时,提示:Redis is configured to save RDB snapshots, but it is currently not able to persis ...
- 解决MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk
1.起因 使用jeecgboot验证码登陆后台时,一直报验证码错误,看控制台发现是redis报错了,具体如下: Error in execution; nested exception is io.l ...
- MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk.
MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. ...
- Redis Is Configured To Save RDB Snapshots, But It Is Currently Not Able To Persist On Disk.
从Redis层面来分析错误的直接原因是: 我们在Redis配置中设置了保存数据库快照,但是当前redis持久化到磁盘失败. 可能有以下情况 情况一: redis使用的磁盘容量满了 解决方法:使用 df ...
- redis报错解决,MISCONF Redis is configured to save RDB snapshots
报错记录 MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on d ...
- Redis - MISCONF Redis is configured to save RDB snapshots 报RDB快照错误
完整的报错信息: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: MIS ...
- 解决redis连接错误:MISCONF Redis is configured to save RDB snapshots, but it is currently not able to...
今天重启游戏服务器在连接redis数据库时突然报错:MISCONF Redis is configured to save RDB snapshots, but it is currently not ...
- 解决redis连接错误:MISCONF Redis is configured to save RDB snapshots
今天Redis服务器在连接redis数据库时突然报错:MISCONF Redis is configured to save RDB snapshots, but it is currently no ...
- Redis_保存数据时报错MISCONF Redis is configured to save RDB snapshots, but it is curren
Redis_保存数据时报错MISCONF Redis is configured to save RDB snapshots, but it is currently not able to pers ...
最新文章
- 网页失去焦点事件 visibilitychange
- 在制造业大厂当程序员是什么感受?
- inrange函数_Python 初学者必备的常用内置函数
- EHCache 初步使用指南
- 做技术,未来出路在哪?
- 备份有困难?Oracle DBA详述RMAN备份
- MYSQL 源代码编绎脚本
- 养老金8000元左右,身体好,无负担,怎样安排退休生活好呢?
- 真我手机信号好还是苹果三星信号好?
- 记某次“静态浮动路由+urpf导致”网络故障排查
- 09年最好看的电影大全_09年最经典的电影大全
- 怎么设置计算机桌面一键关机,图文详解如何设置电脑定时开关机
- 鸿蒙时期电视剧,《我的时代,你的时代》|电视剧简介
- 艾司博讯:拼多多判断正品的标准是什么
- 【HDL系列】乘法器(5)——Radix-2 Booth乘法器
- Java8 StreamFilter
- WAS 6.1 的类加载
- Nodejs编程(2)
- 开源架构Fabric、FISCO BCOS(以下简称“BCOS”)、CITA 技术对比
- docker部署命令