MySQL Percona Slave Replication Change Channel Name

I had inadvertently set up slave replication using the wrong channel name – which is a minor issue except that it caused some issues with an already configured Nagios check. To ‘change’ the channel name I stopped the slave process, removed all the slave definitions and used ‘CHANGE MASTER’ to re-create the slave from the appropriate starting point – as follows:

  • STOP SLAVE;
    • This willl stop the MySQL slave from getting updates from the master
  • SHOW SLAVE STATUS\G
    • Note the values for Relay_Master_Log_File and Exec_Master_Log_Pos to use in the CHANGE MASTER command below (although they may be the same do not use Master_Log_File
      or Read_Master_Log_Pos as explained here)
  • RESET SLAVE ALL;
    • This will remove the currently configured replications shown in ‘SHOW SLAVE STATUS’
  • CHANGE MASTER TO MASTER_HOST=’yourmasterdbserver.com’,MASTER_USER=’replication’,MASTER_PASSWORD=’opensesame’,MASTER_LOG_FILE=’dbl-bin.003188′, MASTER_LOG_POS=695823145 FOR CHANNEL ‘replication_channel_name’;
  • START SLAVE;
  • SHOW SLAVE STATUS\G
    • You hopefully have a slave that is updating from the master with the channel name you wanted.

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>