刚开始学习使用redis数据库,在执行删除命令时,提示了我这么一个错误:
错误提示
(error) 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. 大意是: (错误)misconf redis配置为保存RDB快照,但它当前无法在磁盘上持久。可以修改数据集的命令被禁用,因为此实例被配置为在RDB快照失败时报告写入过程中的错误(在bgsave错误选项上停止写入)。有关RDB错误的详细信息,请查看redis日志。
根据错误提示可以大致判断是快照的问题引起的,使用info命令查看一下:
解决方案
1 127.0.0.1:6379> CONFIG SET stop-writes-on-bgsave-error no
该命令的作用是关闭stop-writes-on-bgsave-error选项,这样这个问题就可以解决掉了。