codis实例同步遇到的问题

1430阅读 0评论2016-12-13 qingheliu
分类:LINUX

1:在redis实例上执行bgsave报错
MASTER aborted replication with an error: ERR Unable to perform background save
解决方法:
添加vm.overcommit_memory = 1到/etc/sysctl.conf或者sysctl vm.overcommit_memory=1临时生效.
问题即可解决
2:'I/O error trying to sync with MASTER: connection lost'
原因:
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的缓存满了,再来一次。)

解决方法:
config set client-output-buffer-limit 'slave 2036870912 1534217728 300'
上一篇:mysql5.7下修改密码
下一篇:Aborted connection to db (Got an error reading communication packets)