We have MySQL replication running for our application. Right now the slave fails to resume if it fails to connect to the server for some time.
We get the error below:
[ERROR] Slave I/O: error connecting to master 'replication-user@master-ip:3306' - retry-time: 60 retries: 186, Error_code: 1045
The above is possible because of power failure or network problems. Once the issue is fixed and it is able to connect to the master server it tries to resume but most of the times it fails with the error below:
[ERROR] Slave SQL: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave. Error_code: 1594
I followed this question and solved this problem by resetting the slave to last read relay-bin file and position. The problem is that the connection failure has become very frequent and we need to do the same thing pretty often.
What could be the possible reason of this occurring over and over again? Is there a way to overcome this problem?
Note: We are using MySQL 5.6.30.
[ERROR] Slave I/O: error connecting to master 'replication-user@master-ip:3306' - retry-time: 60 retries: 186, Error_code: 1045
.