首页 > 数据库技术 > 详细

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

时间:2019-04-06 14:45:15      阅读:432      评论:0      收藏:0      [点我收藏+]

异常

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使其生效

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

原文:https://www.cnblogs.com/zuier/p/10661647.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!