Redis is configured to save RDB snapshots redis的 rdb持久化错误

错误现象 :

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

在这里插入图片描述

解决方案 :

关闭 redis

ps -aux | grep 'redis*'

在这里插入图片描述

忽略持久化异常,继续写入

修改 redis.conf

sudo vim redis.conf

在这里插入图片描述

redis快照被强制关闭了导致不能持久化的问题

设置为

stop-writes-on-bgsave-error no

在这里插入图片描述

修改Linux内存分配策略

vim /etc/sysctl.conf

在这里插入图片描述

vm.overcommit_memory = 1

在这里插入图片描述

内存分配策略参数

overcommit_memory 参数说明: 设置内存分配策略(可选,根据服务器的实际情况进行设置) ,可选值:0、1、2。

  • 0:表示内核将检查是否有足够的可用内存供应用进程使用;如果有足够的可用内存,内存申请允许;否则,内存申请失败,并把错误返回给应用进程。
  • 1:表示内核允许分配所有的物理内存,而不管当前的内存状态如何。
  • 2:表示内核允许分配超过所有物理内存和交换空间总和的内存。

猜你喜欢

转载自blog.csdn.net/qq_44226094/article/details/116096581