reids 故障 'I/O error trying to sync with MASTER: connection lost'

现象:

业务出现告警,业务未处理数量增加,发现连接reids很慢。然后再去PING redis机器发现 内网PING redis server 延迟很高 1000ms以上.

排查过程:

    []换网线不起作用。发现网卡一直在100M左右,然后又发现网卡口协商的是百兆,可能是交换机的问题[/][]为什么会有100M的流量呢。redis 主从之间流量异常 查看redis log 的时候可以看到[/]
[2325] 25 Dec 14:55:32.400 * MASTER  SLAVE sync started
[2325] 25 Dec 14:55:32.400 * Non blocking connect for SYNC fired the event.
[2325] 25 Dec 14:55:32.433 * Master replied to PING, replication can continue...
[2325] 25 Dec 14:55:32.447 * Partial resynchronization not possible (no cached master)
[2325] 25 Dec 14:55:32.457 * Full resync from master: de89c0fdb8ecf70677585245f69ad956a4275102:33404969647192
[2325] 25 Dec 14:56:37.159 * MASTER  SLAVE sync: receiving 3609059211 bytes from master
[2325] 25 Dec 14:59:12.193 # I/O error trying to sync with MASTER: connection lost
      3、从redis不停的去从主上同步数据,但一直lost       4、为什么LOST呢。 google了一下
client-output-buffer-limit 这个参数对slave 同步时候所用的buffer做限制了

默认值是这个 client-output-buffer-limit slave 256mb 64mb 60(这是说负责发数据给slave的client,如果buffer超过256m或者连续60秒超过64m,就会被立刻强行关闭!!! Traffic大的话一定要设大一点。否则就会出现一个很悲剧循环,Master传输一个大的RDB给Slave,Slave努力的装载,但还没装载 完,Master对client的缓存满了,再来一次。)
      5、这里有个插曲。
因为redis不能重启。要用命令config set client-output-buffer-limit 这个命令 因为我用的是telnet在设置config set client-output-buffer-limit ‘slave 536870912 134217728 120′ 这样一直不成功。报参数不正确

Wrong number of arguments for CONFIG SET”

用redis-cli 就正常,应该是空格的问题,不细查了。

有将近9个GB的数据redis_master,然后设置成 ‘slave 536870912 134217728 120’还是同步失败,最后设置成了confg set client-output-buffer-limit ‘slave 2036870912 1534217728 300’就成功了,所以这个设置还得根据你同步数据的多少有针对性的设定。

0 个评论

要回复文章请先登录注册