Redis报错MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on

博客讨论了Redis在尝试保存RDB快照时遇到的错误,由于配置问题导致无法持久化到磁盘并阻止了数据写入。解决方法是设置`stop-writes-on-bgsave-error`参数为`no`,允许在bgsave异常时继续写入。此外,还提供了通过命令行和修改配置文件来调整此设置的步骤。
摘要由CSDN通过智能技术生成

1.错误信息

org.redisson.client.RedisException: MISCONF Redis is configured to save RDB snapshots, 
but is currently not able to persist on disk. Commands that may modify the data set are disabled. 
Please check Redis logs for details about the error.. channel: [id: 0x1ede2079, L:/127.0.0.1:47886 - 
R:localhost/127.0.0.1:6379] command: (PSETEX), params: [APPT_AUTH_START, 86400000, 
PooledUnsafeDirectByteBuf(ridx: 0, widx: 13, cap: 256)]
	at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:371)
	at org.redisson.client.handler.CommandDecoder.decodeCommand(CommandDecoder.java:215)
	at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:153)
	at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:122)

保存RDB快照,但当前无法持久保存在磁盘上。可能修改数据集的命令被禁用。
错误原因

  1. 强制把redis快照关闭了导致不能持久化。
  2. 项目开启了snapshot的持久化模式,且存在大量写入的时候bgsave持久化异常,导致客户端写入数据失败。

解决
设置参数stop-writes-on-bgsave-error为no,也即bgsave异常的时候不要阻止继续写入数据。
通过命令设置:

#进入redis
redis-cli -h 127.0.0.1 -p 6379
config set stop-writes-on-bgsave-error no

修改redis.conf文件

vim打开redis.conf
快速定位 /stop-writes-on-bgsave-error 把es设置为no
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值