同步故障Last_Errno:1061
2015-07-01 09:00
183 查看
1051处理完又出现好多1061的错误。
mysql>show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 10.128.45.8
Master_User: slave
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000036
Read_Master_Log_Pos: 259947402
Relay_Log_File: mysqld-relay-bin.000039
Relay_Log_Pos: 795208907
Relay_Master_Log_File: mysql-bin.000016
Slave_IO_Running: Yes
Slave_SQL_Running: No
Last_Errno: 1061
Last_Error: Error 'Duplicate key name 'Index_Feed_Record_Time'' on query. Default database: 'storefeedback500'. Query: 'ALTER TABLE feedback_record ADD INDEX `Index_Feed_Record_Time` USING BTREE(`feedback_time`)'
error log报错如下:
2015-06-24 08:44:09 2804 [ERROR] Slave SQL: Error 'Duplicate key name 'Index_Feed_Record_person'' on query. Default database: 'storefeedback500'. Query:
'ALTER TABLE feedback_record ADD INDEX `Index_Feed_Record_person` USING BTREE(`feedback_person_id`)', Error_code: 1061
2015-06-24 08:44:09 2804 [Warning] Slave: Duplicate key name 'Index_Feed_Record_person' Error_code: 1061
2015-06-24 08:44:09 2804 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000016' position 795212720
2015-06-24 08:48:32 2804 [Warning] Slave SQL: If a crash happens this configuration does not guarantee that the relay log info will be consistent, Error_code: 0
2015-06-24 08:48:32 2804 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000016' at position 795212720, relay log './mysqld-relay-bin.000039' position: 795212883
从库中已经存在相关索引,主库再添加则报错。原因还没弄清楚。
查看从库
mysql> show index from feedback_record;
+--------------+---------+---------------+-----------+------------+----------+------------+---------+-------+------+---------+------+-----+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+--------------+---------+---------------+-----------+------------+----------+------------+---------+-------+------+---------+------+-----+
| feedback_record | 0 | PRIMARY
| 1 | id | A | 1424178 | NULL | NULL |
| BTREE | | |
| feedback_record | 1 | FK_Reference_10
| 1 | feedback_id | A | 41
| NULL | NULL | YES | BTREE | | |
| feedback_record | 1 | Index_Feed_Record_person | 1 | feedback_person_id | A | 20
| NULL | NULL | YES | BTREE | | |
| feedback_record | 1 | Index_Feed_Record_Time
| 1 | feedback_time | A | 27388
| NULL | NULL |
| BTREE | | |
+--------------+---------+---------------+-----------+------------+----------+------------+---------+-------+------+---------+------+-----+
可以手动删除报错的索引,解决如下:
mysql> use storefeedback500
mysql> drop index feedback_index_sponsor_id on feedback;
mysql> start slave
参考:
http://blog.itpub.net/15456724/viewspace-682681/
mysql>show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 10.128.45.8
Master_User: slave
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000036
Read_Master_Log_Pos: 259947402
Relay_Log_File: mysqld-relay-bin.000039
Relay_Log_Pos: 795208907
Relay_Master_Log_File: mysql-bin.000016
Slave_IO_Running: Yes
Slave_SQL_Running: No
Last_Errno: 1061
Last_Error: Error 'Duplicate key name 'Index_Feed_Record_Time'' on query. Default database: 'storefeedback500'. Query: 'ALTER TABLE feedback_record ADD INDEX `Index_Feed_Record_Time` USING BTREE(`feedback_time`)'
error log报错如下:
2015-06-24 08:44:09 2804 [ERROR] Slave SQL: Error 'Duplicate key name 'Index_Feed_Record_person'' on query. Default database: 'storefeedback500'. Query:
'ALTER TABLE feedback_record ADD INDEX `Index_Feed_Record_person` USING BTREE(`feedback_person_id`)', Error_code: 1061
2015-06-24 08:44:09 2804 [Warning] Slave: Duplicate key name 'Index_Feed_Record_person' Error_code: 1061
2015-06-24 08:44:09 2804 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000016' position 795212720
2015-06-24 08:48:32 2804 [Warning] Slave SQL: If a crash happens this configuration does not guarantee that the relay log info will be consistent, Error_code: 0
2015-06-24 08:48:32 2804 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000016' at position 795212720, relay log './mysqld-relay-bin.000039' position: 795212883
从库中已经存在相关索引,主库再添加则报错。原因还没弄清楚。
查看从库
mysql> show index from feedback_record;
+--------------+---------+---------------+-----------+------------+----------+------------+---------+-------+------+---------+------+-----+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+--------------+---------+---------------+-----------+------------+----------+------------+---------+-------+------+---------+------+-----+
| feedback_record | 0 | PRIMARY
| 1 | id | A | 1424178 | NULL | NULL |
| BTREE | | |
| feedback_record | 1 | FK_Reference_10
| 1 | feedback_id | A | 41
| NULL | NULL | YES | BTREE | | |
| feedback_record | 1 | Index_Feed_Record_person | 1 | feedback_person_id | A | 20
| NULL | NULL | YES | BTREE | | |
| feedback_record | 1 | Index_Feed_Record_Time
| 1 | feedback_time | A | 27388
| NULL | NULL |
| BTREE | | |
+--------------+---------+---------------+-----------+------------+----------+------------+---------+-------+------+---------+------+-----+
可以手动删除报错的索引,解决如下:
mysql> use storefeedback500
mysql> drop index feedback_index_sponsor_id on feedback;
mysql> start slave
参考:
http://blog.itpub.net/15456724/viewspace-682681/
相关文章推荐
- 同步故障Last_Errno:1051
- Jump gameII
- mysqlbinlog: unknown variable
- Spring MVC之@RequestMapping 详解
- OJ第三批——Problem L: C++继承(改错题)
- 主库异常宕机---从库复制报fatal error 1236
- Linux下清理内存和Cache方法
- Android App data write as file data with synchronous Demo
- 179.Largest Number
- SQL Profile一次SQL优化
- onItemClick 参数解释
- oracle存储过程常用技巧
- bitmap conversion from rowids
- POI对Excel自定义日期格式的读取
- 为什么我不想成为Web前端程序员
- Linux笔记:源码安装lamp
- UVA 11388 GCD LCM 思维题==
- python中的Lock
- SQL:多表关联采取这一纪录迄今为止最大
- 大数据能帮助贵州实现跨越式发展吗?