Daisy Chain Replication: Add Server

The steps below explain how to add a new server when using daisy chain Replication. Related link: Daisy Chain Replication.

  • The server should be added after business hours because you will need to stop the MySQL service and no one can be using a database.
  • Every time you add or remove a server, you must also change the auto_increment_increment variable in the my.ini file on all servers to reflect the new total number of servers. It is best to alter the session table on all slaves to make the next id be greater than the id allocated by any of the slaves to date.

  1. Shutdown all workstations. Shutdown Workstations
  2. On the new server (location) install the MySQL application if it is not already installed.
    • Download the Trial version.
    • Right click on the downloaded file and Run as administrator.
    • Click Update MySQL to check the appropriate boxes.
    • Make any changes if needed to data paths.
    • Click Install. The installer will begin to install the MySQL Server.
    • Follow the directions carefully. We recommend using the default selections.
    • When you reach the MySQL Server Setup window, uncheck the Launch the MySQL Instance Configuration Wizard box then click Finish.
  3. On all existing servers:
    • Run the following SQL statement: STOP SLAVE;(This stops the replication thread within MySQL.)
    • Stop the MySQL service.
    • Open the my.ini file and update the auto_increment_increment value to reflect the new total number of servers.
    • Backup and remove all files in the mysql data directory which do not reside in a subfolder, except for any files beginning with ib (e.g. iblog_file0, ib_logfile1, ibdata1).
    • On all slave servers (not the server with the most up-to-date data (master)): Backup and remove the current replicated database (typically named opendental) from the data directory. You must fully complete the above steps on all replication servers before proceeding to next step or replication will fail.
    • Copy the database folder on the master to the data directory on all slaves.
  4. On the new replication servers, set autoincrement / offset variables in the my.ini file. Do this before going to the next step. See Replication Auto Increment.
  5. Repeat steps 6 - 10 from Daisy Chain Replication.
  6. On all replication servers: Verify that replication is running successfully by executing the following SQL statement and checking for the Slave_IO_Running and Slave_SQL_Running columns to both say Yes: SHOW SLAVE STATUS;
  7. On all replication servers: If you blocked the MySQL service network port in step 1, unblock it, making sure to unblock incoming and outgoing.