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 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.;

nested exception is redis.clients.jedis.exceptions.JedisDataException:

经过检查系统的内存以及磁盘,发现磁盘已满,导致了此错误的发生。
解决办法:

1. 释放无用磁盘文件。释放磁盘空间

如果是redis异常退出导致的上述错误,执行:

> config set stop-writes-on-bgsave-error no

拓展

redis 的aof 如果不设置,在一定使用时间后,其占用大小较大。

可以通过在redis cli 中执行如下指令,精简aof文件:

BGREWRITEAOF

发表评论

电子邮件地址不会被公开。 必填项已用*标注