免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3764 | 回复: 9
打印 上一主题 下一主题

有关Mysql Replication不能同步的问题 [复制链接]

论坛徽章:
6
数据库技术版块每日发帖之星
日期:2015-10-11 06:20:00数据库技术版块每日发帖之星
日期:2015-10-12 06:20:00数据库技术版块每日发帖之星
日期:2015-10-15 06:20:00数据库技术版块每日发帖之星
日期:2015-10-30 06:20:00综合交流区版块每月发帖之星
日期:2015-12-02 14:59:01数据库技术版块每日发帖之星
日期:2015-12-15 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-11-02 12:50 |只看该作者 |倒序浏览
我现在有4台机器,有一台是master 其它三台为slave,而其中有一台slave机器上有时间数据不能与master同步,而其它的两台slave是没有问题的!在有问题的那台slave上的部分日志如下:051023  0:00:04  Aborted connection 24799710 to db: 'message' user: 'www' host: `10.0.153.92' (Got an error reading communication packets)
ERROR: 1062  Duplicate entry 'message_11_6_22-22168' for key 1
051023 11:21:47  Slave: Error 'Duplicate entry 'message_11_6_22-22168' for key 1' on query. Default database: 'new_message'. Query: 'insert into viewcount(tbname,thread_seq,viewcount) values('message_11_6_22',22168,1)', Error_code: 1062
051023 11:21:47  Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log '4a-d02-a6-bin.060' position 78400980
051023 11:48:12  Slave I/O thread killed while reading event
051023 11:48:12  Slave I/O thread exiting, read up to log '4a-d02-a6-bin.060', position 89606383
051023 11:49:30  Slave SQL thread initialized, starting replication in log '4a-d02-a6-bin.061' at position 434, relay log './4a-d02-a8-relay-bin.001' position: 4
051023 11:49:30  Slave I/O thread: connected to master 'slaver@10.0.153.120:3306',  replication started in log '4a-d02-a6-bin.061' at position 434
051023 19:55:52  Aborted connection 24898955 to db: 'test' user: 'root' host: `localhost' (Got timeout reading communication packets)
ERROR: 1146  Table 'new_message.message_12_2_448' doesn't exist
051024 11:38:41  Slave: Error 'Table 'new_message.message_12_2_448' doesn't exist' on query. Default database: 'new_message'. Query: 'insert into message_12_2_448 (reply_id,thread_seq,head_reply_seq,u1_flg,show_flg,ip_addr,livedoor_id,livedoor_id_dummy,title,inputdate,body) values ('','2','','5','1','218.224.27.31','rie_kan1','rie_kan1','セクシーヒップ  綺麗なお姉さんは好きですか?','2005-10-24 11:38:41','綺麗なお姉さんは好きですか?rnrn■ エッチなプログ! 痴女???rn貴方の趣味に合わせた大人の出逢いを??? rnrn【URL】http://www.fry.to/aijinnrn【URL】http://www.fry.to/aijinnrnrnアダルト、エッチな??セックスフレンド募集!rnrnrnrnrnrn99rn')', Error_code: 1146
051024 11:38:41  Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log '4a-d02-a6-bin.061' position 816165734
051024 11:52:43  Slave I/O thread killed while reading event
051024 11:52:43  Slave I/O thread exiting, read up to log '4a-d02-a6-bin.061', position 827296105
051024 11:59:46  Slave SQL thread initialized, starting replication in log '4a-d02-a6-bin.062' at position 6357, relay log './4a-d02-a8-relay-bin.001' position: 4
051024 11:59:46  Slave I/O thread: connected to master 'slaver@10.0.153.120:3306',  replication started in log '4a-d02-a6-bin.062' at position 6357
ERROR: 1146  Table 'new_message.message_1_7_375' doesn't exist
051024 23:09:30  Slave: Error 'Table 'new_message.message_1_7_375' doesn't exist' on query. Default database: 'new_message'. Query: 'insert into message_1_7_375 (reply_id,thread_seq,head_reply_seq,u1_flg,show_flg,ip_addr,livedoor_id,livedoor_id_dummy,title,inputdate,body) values ('','3','','0','1','221.185.42.13','kai102351','kai102351','最高!!','2005-10-24 23:09:28','なDVD販売サイトを紹介します!!rn高画質&激安なナイスなサイトです!!rnおすすめですので、是非一度ご覧ください!!!rnhttp://www.geocities.jp/katou784159')', Error_code: 1146
051024 23:09:30  Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log '4a-d02-a6-bin.062' position 377413766
051024 23:16:26  Slave I/O thread killed while reading event
051024 23:16:26  Slave I/O thread exiting, read up to log '4a-d02-a6-bin.062', position 382956271
051024 23:19:01  Slave SQL thread initialized, starting replication in log '4a-d02-a6-bin.063' at position 1710, relay log './4a-d02-a8-relay-bin.001' position: 4
051024 23:19:01  Slave I/O thread: connected to master 'slaver@10.0.153.120:3306',  replication started in log '4a-d02-a6-bin.063' at position 1710
051026  0:00:03  Aborted connection 25985650 to db: 'kawase' user: 'www' host: `10.0.153.55' (Got an error reading communication packets)
051026  0:00:06  Aborted connection 25985680 to db: 'message' user: 'www' host: `10.0.153.92' (Got an error reading communication packets)
051027  0:00:00  Aborted connection 26312514 to db: 'kawase' user: 'www' host: `10.0.153.88' (Got an error reading communication packets)
051029 12:01:07  Aborted connection 26951037 to db: 'message' user: 'www' host: `10.0.153.43' (Got an error reading communication packets)
ERROR: 1146  Table 'new_message.message_12_2_448' doesn't exist
051029 13:41:45  Slave: Error 'Table 'new_message.message_12_2_448' doesn't exist' on query. Default database: 'new_message'. Query: 'insert into message_12_2_448 (reply_id,thread_seq,head_reply_seq,u1_flg,show_flg,ip_addr,livedoor_id,livedoor_id_dummy,title,inputdate,body) values ('','3','','0','1','210.146.167.2','cutie_pie55','cutie_pie55','大人の出会い','2005-10-29 13:41:45','素敵な出会いを提供いたします。rn有料? No!完全無料です!→安心rnサクラ? No!一切おりません!→確実rn携帯情報? No!入力の必要ありません!→安全rnフリーアドレス? Yes!使えます!→さらに安心rn安心?安全?完全無料!!rnあなたの好みの女性に必ず出会えます。rnhttp://sefurex.h.fc2.com/s/rn※美女率No.1です。rnrn')', Error_code: 1146
051029 13:41:45  Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log '4a-d02-a6-bin.066' position 478567319
051029 14:04:05  Slave I/O thread killed while reading event
051029 14:04:05  Slave I/O thread exiting, read up to log '4a-d02-a6-bin.066', position 489549584
051029 14:16:58  Slave SQL thread initialized, starting replication in log '4a-d02-a6-bin.068' at position 16258, relay log './4a-d02-a8-relay-bin.001' position: 4
051029 14:16:58  Slave I/O thread: connected to master 'slaver@10.0.153.120:3306',  replication started in log '4a-d02-a6-bin.068' at position 16258
051030  0:00:03  Aborted connection 27081060 to db: 'new_message' user: 'www' host: `10.0.153.92' (Got an error reading communication packets)
051030  0:00:09  Aborted connection 27081080 to db: 'new_message' user: 'www' host: `10.0.153.92' (Got an error reading communication packets)
ERROR: 1146  Table 'new_message.message_12_2_448' doesn't exist
051101 20:15:16  Slave: Error 'Table 'new_message.message_12_2_448' doesn't exist' on query. Default database: 'new_message'. Query: 'update message_12_2_448 set show_flg=0', Error_code: 1146
051101 20:15:16  Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log '4a-d02-a6-bin.070' position 453207748
051101 20:33:30  Slave I/O thread killed while reading event
051101 20:33:30  Slave I/O thread exiting, read up to log '4a-d02-a6-bin.070', position 464376613
051101 20:38:24  Slave SQL thread initialized, starting replication in log '4a-d02-a6-bin.071' at position 25357, relay log './4a-d02-a8-relay-bin.001' position: 4
051101 20:38:24  Slave I/O thread: connected to master 'slaver@10.0.153.120:3306',  replication started in log '4a-d02-a6-bin.071' at position 25357
请大家帮忙分析是什么原因所造成的?谢谢了!

论坛徽章:
0
2 [报告]
发表于 2005-11-02 12:53 |只看该作者
'message' user: 'www' host: `10.0.153.92' (Got an error reading communication packets)
ERROR: 1062  Duplicate entry 'message_11_6_22-22168' for key 1

这里说的很清楚了,是因为你用了唯一索引,导致 key 重复了,写不进去,失败。

论坛徽章:
6
数据库技术版块每日发帖之星
日期:2015-10-11 06:20:00数据库技术版块每日发帖之星
日期:2015-10-12 06:20:00数据库技术版块每日发帖之星
日期:2015-10-15 06:20:00数据库技术版块每日发帖之星
日期:2015-10-30 06:20:00综合交流区版块每月发帖之星
日期:2015-12-02 14:59:01数据库技术版块每日发帖之星
日期:2015-12-15 06:20:00
3 [报告]
发表于 2005-11-02 12:56 |只看该作者
slave是向master读取binlog的,怎么会出现key 重复呢?还有其它的两台就不会出现这个问题!

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
4 [报告]
发表于 2005-11-02 12:58 |只看该作者
原帖由 love100 于 2005-11-2 12:50 发表
我现在有4台机器,有一台是master 其它三台为slave,而其中有一台slave机器上有时间数据不能与master同步,而其它的两台slave是没有问题的!在有问题的那台slave上的部分日志如下:051023  0:00:04  Aborted conne ...



哇噻,黄色电影啊,哪里有下载的可以看的啊?

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
5 [报告]
发表于 2005-11-02 12:59 |只看该作者
怎么还有数据表找不到啊

论坛徽章:
6
数据库技术版块每日发帖之星
日期:2015-10-11 06:20:00数据库技术版块每日发帖之星
日期:2015-10-12 06:20:00数据库技术版块每日发帖之星
日期:2015-10-15 06:20:00数据库技术版块每日发帖之星
日期:2015-10-30 06:20:00综合交流区版块每月发帖之星
日期:2015-12-02 14:59:01数据库技术版块每日发帖之星
日期:2015-12-15 06:20:00
6 [报告]
发表于 2005-11-02 13:01 |只看该作者
晕,哪里有什么黄色电影呀!汗...........................帮忙分析一下原因吧!

论坛徽章:
6
数据库技术版块每日发帖之星
日期:2015-10-11 06:20:00数据库技术版块每日发帖之星
日期:2015-10-12 06:20:00数据库技术版块每日发帖之星
日期:2015-10-15 06:20:00数据库技术版块每日发帖之星
日期:2015-10-30 06:20:00综合交流区版块每月发帖之星
日期:2015-12-02 14:59:01数据库技术版块每日发帖之星
日期:2015-12-15 06:20:00
7 [报告]
发表于 2005-11-02 13:25 |只看该作者
还我还想问一下,当复制出现错误时,再次起动slave时它是接着上次出错的地方进行复制吗?

论坛徽章:
0
8 [报告]
发表于 2005-11-02 18:43 |只看该作者
如果这个错误不解决的话,slave一样不能继续复制。别的slave不出问题,不代表别的slave就不出问题,事实上应该就是key重复了。
如果想置之不理,可以:
SET [ GLOBAL ]SQL_SLAVE_SKIP_COUNTER = n; (n值自己设定)
然后重新让slave运行

论坛徽章:
6
数据库技术版块每日发帖之星
日期:2015-10-11 06:20:00数据库技术版块每日发帖之星
日期:2015-10-12 06:20:00数据库技术版块每日发帖之星
日期:2015-10-15 06:20:00数据库技术版块每日发帖之星
日期:2015-10-30 06:20:00综合交流区版块每月发帖之星
日期:2015-12-02 14:59:01数据库技术版块每日发帖之星
日期:2015-12-15 06:20:00
9 [报告]
发表于 2005-11-02 20:32 |只看该作者
谢谢!

论坛徽章:
0
10 [报告]
发表于 2005-11-02 21:38 |只看该作者
那个第三台服务器是不是后加入的,复制要开始的时候,再主服务器上最好做个reset master
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP