MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Com

异常

Caused by: redis.clients.jedis.exceptions.JedisDataException: MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.
        at redis.clients.jedis.Protocol.processError(Protocol.java:127)
        at redis.clients.jedis.Protocol.process(Protocol.java:161)
        at redis.clients.jedis.Protocol.read(Protocol.java:215)
        at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:340)
        at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:239)
        at redis.clients.jedis.BinaryJedis.set(BinaryJedis.java:211)
        at org.springframework.data.redis.connection.jedis.JedisConnection.set(JedisConnection.java:1234)
        ... 115 more

原因

log:Can’t save in background: fork: Cannot allocate memory
Redis持久化异常,bgsave时会fock主进程持久化。内存需求*2,内存不足报错

解决

1、先让程序不报错,客户端执行:config set stop-writes-on-bgsave-error no

2、修改系统变量:/etc/sysctl.conf增加配置:vm.overcommit_memory = 1

或者运行命令sysctl vm.overcommit_memory=1使其生效

上一篇:Configure time service clients


下一篇:redis 连接idea一直被拒绝