1. 程式人生 > >redis.clients.jedis.exceptions.JedisDataException: MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk.

redis.clients.jedis.exceptions.JedisDataException: MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk.

今天執行專案,redis突然出現以下問題:

redis.clients.jedis.exceptions.JedisDataException: 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日誌,如下:

如上大致意思是=>警告:過量使用記憶體設定為0!在低記憶體環境下,後臺儲存可能失敗。為了修正這個問題,請在/etc/sysctl.conf 新增一項 'vm.overcommit_memory = 1' ,然後重啟(或者執行命令'sysctl vm.overcommit_memory=1' )使其生效。

然後按照日誌提示解決:

重啟redis,之後問題解決