点击上方“IT那活儿”公众号--专注于企业全栈运维技术分享,不管IT什么活儿,干就完了!!!
2.1 报错现象分析

Error in execution; nested exception is
io.lettuce.core.RedisCommandExecutionException: 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 服务相应时段日志:



bgsave方法为什么会失败呢?(思考)
采用 Redis 建议的配置是为了在极端情况下 Linux 可以挤出来一些内存供 Redis 备份,但是更建议优先配置好 maxmemory ,给机器留 20%~30% 的空闲内存。
3.1 系统优化层面
#vm.overcommit_memory = 1,直接放行。
# vm.overcommit_memory = 0:则比较 此次请求分配的虚拟内存大小和系统当前空闲的物理内存加上swap,决定是否放行。
设置方法:
临时:通过命令修改,立即生效。重启后会失效; sysctl vm.overcommit_memory=1 永久:再将改动写入系统配置文件,使其永久有效; echo "vm.overcommit_memory=1" >> etc/sysctl.conf sysctl -p 使其生效
ps aux | grep redis

redis-server /app1/opt/redis/conf/redis-6379.conf
redis-server /app1/opt/redis/conf/redis-6380.conf


本文作者:张佳鑫(上海新炬中北团队)
本文来源:“IT那活儿”公众号

文章转载自IT那活儿,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。





