mysql 丛库不同步
2015-09-29 00:00
603 查看
摘要: mysql 丛库停止同步问题
在一台丛库上发现 不同步了,查看丛库状态如下: mysql> show slave status\G; *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: 10.51.180.93 Master_User: slaveuser Master_Port: 3306 Connect_Retry: 60 Master_Log_File: mysql-bin.000278 Read_Master_Log_Pos: 979285779 Relay_Log_File: appadmin-02-relay-bin.000177 Relay_Log_Pos: 4349 Relay_Master_Log_File: mysql-bin.000278 Slave_IO_Running: Yes Slave_SQL_Running: No Replicate_Do_DB: Replicate_Ignore_DB: mysql,information_schema,performance_schema,log,test,tmp Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 1062 Last_Error: Error 'Duplicate entry '110842310' for key 'PRIMARY'' on query. Default database: 'boss'. Query: 'insert into message_id_sequence set id = 0' Skip_Counter: 0 Exec_Master_Log_Pos: 907321199 Relay_Log_Space: 979286862 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: NULL Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 3ff8 Last_IO_Error: Last_SQL_Errno: 1062 Last_SQL_Error: Error 'Duplicate entry '110842310' for key 'PRIMARY'' on query. Default database: 'boss'. Query: 'insert into message_id_sequence set id = 0' Replicate_Ignore_Server_Ids: Master_Server_Id: 255 Master_UUID: cadca151-4896-11e5-a6dd-00163e000499 Master_Info_File: /data2/mysql/master.info SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: 150929 11:26:31 Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: Executed_Gtid_Set: Auto_Position: 0 1 row in set (0.00 sec) 发现有个错误,Slave_SQL_Running:NO sql没有运行,key重复了,导致丛库不继续干活了 解决办法: 找到指定的表 删除该重复key的记录, delete from message_id_sequence where id = 110842310; 停止slave stop slave; 重新启动slave start slave; 查看状态: mysql> show slave status\G; 发现状态都正常了,只是落后master,等待赶上就ok了
相关文章推荐
- MySQL中的integer 数据类型
- MySQL存储过程
- 使用 Syncthing 在多个设备间同步文件
- mysql中int、bigint、smallint 和 tinyint的区别与长度
- mysql load data 导出、导入 csv
- source命令执行SQL脚本文件
- MySQL创建用户及权限控制
- MySQL管理数据表
- linux下mysql添加用户
- mysql procedure
- mysql触发器
- MySQL 备份和恢复策略
- mac下安装mysql(转载)
- mysql 修改编码 Linux/Mac/Unix/通用(杜绝修改后无法启动的情况!)
- MySQL数据的导出、导入(mysql内部命令:mysqldump、mysql)
- mysql数据行转列
- Linux下修改MySQL编码的方法
- MySQL Server 日志
- MySQL 安全事宜