A strange MySQL replication fault
A MySQL disaster recovery database is deployed in a remote data center. After the deployment, the replication process looks normal. However, after observing the MySQL error log, the replication thread will be disconnected and reconnected every 30 seconds.
Error Log output by MySQL:
170110 16:07:00 [ERROR] Error reading packet from server: Lost connection to MySQL server during query (server_errno = 2013) 170110 16:07:00 [Note] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'mysql-bin.000362 'at position 948341170110 16:07:45 [ERROR] Error reading packet from server: Lost connection to mysql server during query (server_errno = 2013) 170110 16:07:45 [Note] S Lave I/O thread: Failed reading log event, reconnecting to retry, log 'mysql-bin.000362 'at position 950196 this fault can only be found when troubleshooting error logs, the monitoring replication thread cannot easily detect this problem.
After troubleshooting, it is found that there is a problem with the route from the machine to the main data center. After the route is added, the fault disappears.