User Tools

Site Tools


Writing /app/www/public/data/meta/watchdogs/mysqlslavereplicationfailure.meta failed
watchdogs:mysqlslavereplicationfailure

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
watchdogs:mysqlslavereplicationfailure [2018/09/19 12:27] ywangwatchdogs:mysqlslavereplicationfailure [2021/06/25 10:09] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +**mysqlSlaveReplicationFailure**
  
 +//Author: Yanjun Wang//
 +
 +  - **Step to Resolve Query Running Timeout Issue**
 +
 +  * login into slave database
 +  * run the following commands and copy the result which will be used for further investigation
 +<code>
 +show slave status\G
 +show processlist;
 +show engine innodb status\G
 +show open tables where In_Use > 0;
 +</code>
 +**START to solve the issue**
 +  * run show slave status\G
 +  * check the Last_Errno and Last_Error to identify if it's a timeout issue, and also copy the query for running later.
 +  * run the command to skip that query(will be run manually later) and restart slave 
 +<code>
 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; 
 +START SLAVE;
 +</code>
 +  * run the query you copied manually to keep the slave up-to-date 
 +**END to solve the issue**
 +  * if Last_Error doesn't provide the query or full query, you can either change the bin/relay log, or running percona to catch the difference for the table between master and slave by run this command from master server to check network_element table
 +<code>
 +pt-table-sync -u<user have writer permission> --print --sync-to-master <slave db server IP> --tables <databse name>.<target table name> --ask-pass > file_to_store_query.sql
 +e.g. pt-table-sync -uwriter --print --sync-to-master 10.230.10.15 --tables snmp_manager.network_element --ask-pass > ne.sql
 +</code>
 +  * run the query you get from file_to_store_query.sql, if there is foreign key constraint fails, may check the two items on master and slave manually and find the difference to write an UPDATE query yourself and run the UPDATE query on the slave database