MySQL Forums
Forum List  »  Replication

Wrong replication position after restart
Posted by: David Muoz Vicente
Date: January 10, 2018 08:32AM

I have 2 instances of MySQL 5.7.20-log with a master-slave row replication configuration, both in Red Hat Enterprisa 6.9.

When I issue a "/etc/init.d/mysqld" restart on the slave, it always starts replicating in a previous position os the one it was closed on, unless I execute "STOP SLAVE" before the stop or restart command.

In the log file I can see the entrys from the shutdown process showing a position and also the entry on the start process showing a different position.

2018-01-10T13:46:19.494263Z 0 [Note] Shutting down slave threads
2018-01-10T13:46:19.494296Z 22 [Note] Error reading relay log event for channel '': slave SQL thread was killed
2018-01-10T13:46:19.496301Z 1 [Note] Slave I/O thread killed while reading event for channel ''
2018-01-10T13:46:19.496330Z 1 [Note] Slave I/O thread exiting for channel '', read up to log 'mysql-bin.000297', position 161989494
2018-01-10T13:46:48.280082Z 2 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
2018-01-10T13:46:48.281134Z 2 [Note] Slave I/O thread for channel '': connected to master 'replication@mxec1cv1:3306',replication started in log 'mysql-bin.000297' at position 161193127

As a workaround I can execute a CHANGE MASTER TO MASTER_LOG_POS=XXXX, but I have to go checking the log.

It seems that the "/etc/init.d/mysqld stop" is not stopping the slave properly so the position is not recorded correctly.

Thanks in advance

Options: ReplyQuote

Written By
Wrong replication position after restart
January 10, 2018 08:32AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.