Redis中 MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist
在向redis中加入大量数据(我是60w)时,会报MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk错误.
Redis被配置为保存数据库快照,但它目前不能持久化到硬盘。用来修改集合数据的命令不能用。请查看Redis日志的详细错误信息.
出现这种错误的原因是强制关闭redis快照不能持久化。
解决方法是在redis客户端进行配置让程序忽略此异常:config set stop-writes-on-bgsave-error no
如果后面继续出现以上错误或者在服务端出现错误:
WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.”
(警告:过量使用内存设置为0!在低内存环境下,后台保存可能失败。为了修正这个问题,请在/etc/sysctl.conf 添加一项 ‘vm.overcommit_memory = 1’ ,然后重启(或者运行命令’sysctl vm.overcommit_memory=1’ )使其生效。
则在/etc/sysctl.conf中添加 vm.overcommit_memory = 1然后重启。
还没有评论,来说两句吧...