I have Master slave replication setup on Windows server MySQL 5.6.22 without GTID. With below parameters in my.ini
masterA> my.ini
log_bin=mysql-bin.log
log_bin_index=mysql-bin.index
binlog_format=ROW
max_binlog_size=1073741824
sync_binlog=1
server-id=1
master status: mysql-bin-0002.log POS: 19548
slaveB> my.ini
log_bin=mysql-bin.log
log_bin_index=mysql-bin.index
binlog_format=ROW
max_binlog_size=1073741824
log_slave_updates=ON
sync_binlog=1
relay_log=mysql-relay-bin.log
relay_log_index= mysql-relay-bin.index
max_relay_log_size=1073741824
read_only=1
server-id=2
skip-slave-start
ON slave: mysql-bin-0002.log POS: 19548 * As I have log-bin and log-slave-updates enabled
I need to promote slave as master and master as slave. But I want the new slave to continue from mysql-bin-0002.log POS: 19548. What I need to know is whether below steps are correct. Is it necessary to issue reset slave command on slave
- Stop tomcat so that there are no connections to mysql.
- Verfiy whether master and slave are in sync. if yes then proceed further.
- On SLAVE> stop slave; Change master to master_host=‘’; ###I will keep it blank.
- On SLAVE> comment read_only parameter
- On MASTER> Stop Mysql service. Add below parameters in my.ini
relay_log=mysql-relay-bin.log
relay_log_index= mysql-relay-bin.index
max_relay_log_size=1073741824
read_only=1
log_slave_updates=ON
skip-slave-start - On MASTER> start mysql service. Issue change master to command.
CHANGE MASTER TO MASTER_HOST=‘slaveB IP’,MASTER_USER=‘repluser’,MASTER_PASSWORD=‘replpwd’,MASTER_PORT=3307,MASTER_LOG_FILE=‘mysql-bin.000002’,MASTER_LOG_POS=19548,MASTER_CONNECT_RETRY=10; - Start slave.