在使用docker安装redis时,发现了容器启动关闭的问题
然后查看日志,有3个警告,就算这三个警告导致的redis容器自动关闭
1.The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
原因:一个高负载的环境来说tcp设置128这个值,太小了。
解决方法:找到etc/sysctl.conf文件,将net.core.somaxconn= 1024加入到文件中然后执行sysctl -p生效
2.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.
解决办法
vim /etc/sysctl.conf然后添加:vm.overcommit_memory=1
重新启动或运行命令“sysctl vm.overcommit_memory=1”以使其生效。
3.WARNING Your kernel has a bug that could lead to data corruption during background save. Please upgrade to the latest stable kernel.
解决办法:
将redis服务的配置文件的最后一行的注释打开,就可以启动服务了
docker启动redis时reids服务自动关闭的问题
最新推荐文章于 2024-06-28 12:49:39 发布