架构师_程序员_码农网

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 8512|回复: 1

[Redis] Redis will now exit to prevent data corruption. Note that it is...

[复制链接]
发表于 2021-10-15 09:17:45 | 显示全部楼层 |阅读模式
在国产麒麟操作系统上面部署 redis 的时候,报错如下:

12707:M 14 Oct 2021 13:55:36.643 # Server initialized
12707:M 14 Oct 2021 13:55:36.643 # 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 c
ommand 'sysctl vm.overcommit_memory=1' for this to take effect.12707:M 14 Oct 2021 13:55:36.644 # WARNING Your kernel has a bug that could lead to data corruption during background save. Please upgrade to the latest stable kernel.
12707:M 14 Oct 2021 13:55:36.644 # Redis will now exit to prevent data corruption. Note that it is possible to suppress this warning by setting the following config: ignore-warnings ARM64-COW-BUG

看到网上说需要设置 overcommit_memory 的值,执行命令如下(未测试):

因为我在 centos 系统上面也会存在该警告,但是不影响正常的启动

vm.overcommit_memory

默认值为:0

overcommit_memory 参数说明:

设置内存分配策略(可选,根据服务器的实际情况进行设置)

/proc/sys/vm/overcommit_memory

可选值:0、1、2

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


我的解决方案

执行如下命令,然后重新运行 redis:

(完)





上一篇:docker 如何删除 none 镜像
下一篇:【实战】nginx 反向代理忽略第一层路径
码农网,只发表在实践过程中,遇到的技术难题,不误导他人。
发表于 2021-10-16 00:42:37 | 显示全部楼层
不错不错哦
码农网,只发表在实践过程中,遇到的技术难题,不误导他人。
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

免责声明:
码农网所发布的一切软件、编程资料或者文章仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。

Mail To:help@itsvse.com

QQ|手机版|小黑屋|架构师 ( 鲁ICP备14021824号-2 )|网站地图

GMT+8, 2024-4-27 12:39

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表