Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added summary notes

...

Section


Column
width70%

If you need to change the IP address of a MySQL master server the following should be helpful. Please read through the whole document to get a complete view of the process.

Summary of Steps

  1. Stop IIS on main server
  2. Stop players and readers
  3. Stop slave process
  4. Let them update the IP addresses
  5. Update the slave with the masters new IP address (details below)
  6. Update the players and readers with the new IP
  7. Restart
    1. players
    2. readers
    3. IIS

Master Database Setup

Replication User

Make sure that replication user will be accessible to the slave machines after the IP address change. Check the definition of the user (default is blbackup) for any host limitations that would now prevent access to it.


Code Block
languagesql
themeRDark
SHOW GRANTS FOR 'blbackup';

A sample result will be:

GRANT SELECT, SUPER, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'blbackup'@'%' IDENTIFIED BY PASSWORD '...'

In this example the blbackup user is not restricted but instead uses the % wildcard allowing access from any host IP address so no change to this example user will be required.

Slave Database Setup

You need to stop replication and identify the details needed to identify where to resume replication after updating the slave with the new master IP.


Code Block
languagesql
themeRDark
STOP SLAVE;
SHOW SLAVE STATUS;

In the results of the slave status command look for 2 settings:

  • Relay_Master_Log_File (example: mysql-bin.000023)
  • Exec_Master_Log_Pos (example: 11622542)

We use the values of these fields in the next statement like this: (where the master_host value is the new IP address of the master)


Code Block
languagesql
themeRDark
CHANGE MASTER TO MASTER_HOST='10.0.1.15', MASTER_LOG_FILE='mysql-bin.000023', MASTER_LOG_POS=11622542;
START SLAVE;

The final step should be to issue a SHOW SLAVE STATUS command again (even a couple times) to verify that the replication has resumed successfully.


Code Block
languagesql
themeRDark
SHOW SLAVE STATUS;


References:


Column
width30%


Panel
borderColor#0070b1
bgColor#FFFFFF
borderWidth1

In this section:

Table of Contents
indent15px

Include Page
XA:Promos Top
XA:Promos Top



...