一、错误提示
服务器运行一段时间后提示:
Caused by: 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.
错误原因:Redis配置为保存RDB快照,但目前无法在磁盘上持久化。可能修改数据集的命令被禁用,因为此实例配置为在RDB快照失败时报告写入期间的错误。
二、解决方法(1)
设置 stop-writes-on-bgsave-error
值为no即可避免这种问题。
// 登录
[root@ecs-25376 root]# redis-cli -h 127.0.0.1 -p 6379
OK
127.0.0.1:6379> config set stop-writes-on-bgsave-error no
OK
三、解决方法(2)
直接修改redis.conf配置文件,修改后需要重启redis。
(1)vim打开redis-server配置的redis.conf文件,
(2)找到stop-writes-on-bgsave-error字符串所在位置,
(3)把后面的yes设置为no。