你可能是在一个不错的惊喜,但这里有云:
运行SHOW SLAVE STATUS\G
。例如起见,假设你得到这样的:
Slave_IO_State: Waiting for master to send event
Master_Host: 10.64.68.253
Master_User: replusername
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.003202
Read_Master_Log_Pos: 577991837
Relay_Log_File: relay-bin.010449
Relay_Log_Pos: 306229695
Relay_Master_Log_File: mysql-bin.003202
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 577991837
Relay_Log_Space: 306229695
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: 0
您可以选择从显示如下:
Relay_Master_Log_File
(mysql-bin.003202
)
Exec_Master_Log_Pos
(577991837
)
原因如下:Relay_Master_Log_File
和Exec_Master_Log_Pos
表示来自主设备的binlog条目它到奴隶并成功执行。只需从那里取货。
只需将运行这段代码:Exec_Master_Log_Pos
STOP SLAVE;
CHANGE MASTER TO
MASTER_LOG_FILE='mysql-bin.003202',
MASTER_LOG_POS=577991837;
START SLAVE;
试试看!
CAVEAT
如果Relay_Master_Log_File
不再对法师存在,你可能需要做一些损害控制。鉴于前面提到的SHOW SLAVE STATUS\G
,你可能要跳到下一个二进制日志在主如下:
STOP SLAVE;
CHANGE MASTER TO
MASTER_LOG_FILE='mysql-bin.003203',
MASTER_LOG_POS=4;
START SLAVE;
如果复制赶上,你是不是刚走出困境的。您可能需要下载Percona Toolkit并运行pt-table-checksum和pt-table-sync来修复从站上丢失的数据。
如果复制不起作用,您将不得不进行尽职调查并重新加载从站。
希望如果复制与原始建议一起工作,您可能不必在此警告中做任何事情。
如果您是其中建议的明确命名一个帖子“主的mysql-bin”的,这将导致这个错误,如果这个不匹配 'STOP SLAVE; 更改主人到 MASTER_LOG_FILE ='mysql-bin。003202', MASTER_LOG_POS = 577991837; START SLAVE;' – Conor 2015-02-16 07:25:51