redis主备机数据同步失败的问题

在Redis 6.0.6版本中,遇到备机重启后数据同步失败的问题。问题源于client-output-buffer-limit配置过小,导致主机状态在bg_save和send_bulk间切换,从机出现I/O错误。解决方法是调整redis.conf,将client-output-buffer-limit slave设置为0,或者使用redis-cli临时修改配置,等待数据同步成功。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

redis版本为6.0.6,重启备机后数据同步失败。

查看主机info发现状态一直在bg_save和send_bulk中切换。

查看主机redis.log,出现Client ... scheduled to be closed ASAP for overcoming of output buffer limits.

查看从机redis.log,出现 I/O error trying to sync with MASTER: connection lost

此错误由缓冲区配置,即client-output-buffer-limit配得太小造成。可将client-output-buffer-limit slave(也作client-output-buffer-limit replica)的限制去除。

主从机均需修改以下配置:

1. 打开redis.conf,将replica/slave后三个参数置零

# vi redis.conf

# By default normal clients are not limited because they don't receive data
# without asking (in a push way), but just after a request, so only 
# asynchronous clients may create a scenario where data is requested faster
# than it can read.
#
# Instead there is a default limit for pubsub and replica clients, since
# subscribers and replicas receive data in a push fashion.
#
# Both the hard or the soft l
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值