剛開始學習使用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選項,這樣這個問題就可以解決掉了。
