Redis报错MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on
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快照,但当前无法持久保存在磁盘上。可能修改数据集的命令被禁用。
错误原因
- 强制把redis快照关闭了导致不能持久化。
- 项目开启了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