Parallels H-Sphere Documentation System Administrator Guide


Moving MySQL


Related Docs:   MySQL Server

Last modified: 10 Jan 2008


WARNING: This documentation covers Parallels H-Sphere versions up to 3.1. For the latest up-to-date Parallels H-Sphere documentation, please proceed to the official Parallels site.

This document explains how to move MySQL service between boxes of an H-Sphere cluster.

Step 1. Prepare Servers

  1. Update your H-Sphere to the latest H-Sphere version.
  2. Apply the latest MySQL update, if any, released by Psoft after the installation of your H-Sphere.
  3. Prepare a new box with MySQL using H-Sphere installer.
  4. Using E.Manager, create a new physical server and add the MySQL group (or add this group to the physical server you are planing to move MySQL server to).
  5. In E.Manager, disable signup for the MySQL server.

Step 2. Move MySQL Content

  1. Log into the targer box as root:
  2. Stop MySQL service.
  3. Move the mysql/ directory from the source server:
    rsync -arzgop -e ssh root@<SOURCE_MYSQL_SERVER_IP>:~mysql/ ~mysql/
  4. Start MySQL service.

Step 3. Update System Database

  1. Stop the Control Panel.
  2. Log into the H-Sphere system database and run the following queries:
    update l_server set p_server_id=<TARGET_PHYSICAL_SERVER_ID> where id=<MYSQL_LOGICAL_SERVER_ID>;
    (1 record)
    update l_server_ips set ip='<TARGET_MYSQL_SERVER_IP>', mask='<TARGET_MYSQL_SERVER_MASK>' where l_server_id=<MYSQL_LOGICAL_SERVER_ID> and flag=4;
    (1 record)
  3. Start the Control Panel.

Step 4. Update Resellers' Server Aliases

As the cpanel user, run ServerAliasRenamer:

java --lserver <MYSQL_LOGICAL_SERVER_ID>

Step 5. Synchronize MySQL Content

  1. Stop MySQL service on the source box.
  2. Repeat all of Step 2 above.
  3. If the source box has a mail service, log in there and start MySQL service.

Step 6. Finalize The Migration

  1. Go to E.Manager -> DNS Manager and choose to edit the main service DNS zone. Change the IP in the A DNS record for the MySQL server.
  2. Open the file in the PhpMyAdmin directory. Change the IP of MySQL server in $cfgServers[$i]['host']. $i is the number of the MySQL server in PhpMyAdmin configuration: $i=1,2,..
  3. Check if any of the customer scripts use the MySQL server IP and update all instances.
  4. Install and Configure TCP proxy on the old server to ensure that MySQL hostname resolves to the new IP address during the propagation period.

Step 7. Check Functionality

Now that you have finished the migration, visit a few user websites that use MySQL and verify that everything works smoothly.

Related Docs:   MySQL Server

© Copyright 2018. Parallels Holdings. All rights reserved.