MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk.

本文介绍了当Redis配置为保存RDB快照但无法在磁盘上持久化时的解决方案。提供了两种方法来解决该问题:一是调整内核TCP最大连接数;二是禁用Redis在RDB快照失败时停止写入的功能。

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报这个错   我这边用的docker     发现了两种要做的方案

1.  修改内核 tcp  最大链接((1)请确保你的docker启动给了privileger权限不然改不了内核参数,(2)确保/usr/sbin/init这种启动方式)

eg: 启动docker  参考我的指令 

docker run -itd --privileged --name nn_php_nginx -v /home/vagrant/code:/code -v /etc/localtime:/etc/localtime:ro -p 80:80 nn_php_nginx:1.8 /usr/sbin/init


开始修改tcp 监听队列最大长度内核参数  参考 --(https://blog.csdn.net/ghostyusheng/article/details/80434396)

修改somaxconn

在/etc/sysctl.conf中添加如下

net.core.somaxconn = 2048

然后在终端中执行

sysctl -p


2.修改redis 快照问题 

命令行修改:

127.0.0.1:6379> config set stop-writes-on-bgsave-error no

文件修改:

打开redis-server配置的redis.conf文件,找到stop-writes-on-bgsave-error,把yes设置为no。


评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值