Ingram Micro declares End of Life (EOL) of RedHat EL 5 and CentOS 5 versions of Linux operating system on Service Nodes in Odin Automation. Particularly, MySQL services is being run in RedHat EL 5 should function in RedHat EL 6 or RedHat EL 7 after reaching this EOL.
Migrate MySQL database node from source RedHat EL 5 to new RedHat EL 6 server.
The plan of migration
- Migrate MySQL databases to a destination server.
- Assign the IP addresses from the source server to the destination server.
- Re-register the MySQL node in the OA Provider Panel.
Source server: Generic Linux Node with RedHat EL 5 / CentOS 5 OS and MySQL5 PPM package.
Destination server: RedHat EL 6 / CentOS 6 server with MySQL 5.5 (standard MySQL version). OS packages must be updated.
The servers must be in the same local network.
How to migrate:
1. Prepare a new host with RedHat EL 6 or CentOS 6 for the destination MySQL node and install the MySQL service there.
1.1. Deploy a RedHat EL 6 or CentOS 6-based VPS/VDS/DS.
Assign a temporary IP address to this host to access it during the migration. IP addresses from the source database host (private and public) will be assigned to the destination server after the migration.
1.2. Update the operating system.
# yum update
1.3. Install and start the MySQL service.
# yum install mysql-server # chkconfig --levels 235 mysqld on # service mysqld start
1.4. Migrate the database configuration.
Make sure that the destination MySQL configuration contains the necessary compatible settings from the source.
Especially, [mysqld] section in /etc/my.cnf and included files should be copied to the destination configuration.
Restart the MySQL service after making the changes:
# service mysqld restart
1.5. Assign the credentials of administrative MySQL user to the values of the source server.
Note: You can set administrative MySQL user and password for the source node if you don't keep them in your records.
Go to: OA panel > Infrastructure > Services > MySQL5 > Manage application "MySQL5" > General > Edit > set new values > Submit
2. Migrate MySQL databases from the source server to the destination server.
- Before migrating the databases, back up the source MySQL database directory or the whole source server.
- Plan a maintenance window during the migration to avoid the difference between source and migrated databases. Depending on MySQL data volume, the migration can take one hour or several hours.
- Check the databases after the migration. All databases, tables and records from the source server should be presented on the destination server.
- Instead of using the mysqldump migration described below, you can use a faster method based on copying the data directory /var/lib/mysql to the destination server.
2.1. Mark the source MySQL node as not "ready to provide". Enable maintenance mode for affecting hosting services.
2.2. Migrate MySQL databases using the mysqldump utility.
Make a MySQL dump.
On the source host:
# cat >~/pw_file ENTER_MYSQL_ROOT_PASSWORD Ctrl+D # mysqldump -uroot --password=`cat ~/pw_file` --no-autocommit -A | gzip >dump.gz
Copy the dump file to the destination host.
On the source host:
# rsync -e ssh --append-verify -P dump.gz root@DESTINATION:
Restore the data from the MySQL dump.
On the destination host:
# cat >~/pw_file ENTER_MYSQL_ROOT_PASSWORD Ctrl+D # gunzip <dump.gz | mysql -uroot --password=`cat ~/pw_file`
You can remove the dump.gz file after you have checked the result.
Dumping and restoring can be performed without a temporary dump file:
# mysqldump -uroot --password=`cat ~/pw_file` --no-autocommit -A | gzip | \ ssh root@DESTINATION: 'gunzip | mysql -uroot --password=`cat ~/pw_file`'
Upgrade MySQL databases:
# mysql_upgrade -uroot --password=`cat ~/pw_file`
Apply migrated user credentials:
# mysql -uroot --password=`cat ~/pw_file` -e'flush privileges'
Copy ~/pw_file from the source server to the destination server, because MySQL root user credentials were also restored from user_dump.gz.
3. Move the IP addresses (private and public) from the source server to the destination server and turn off the source server.
NOTE: If destination server had the hostname different from the source one, OA control panel would still display the hostname of source server once re registration completed. To avoid the confusion, change the hostname of destination server accordingly.
3.1. On the source server, change the IP addresses (private and public) to some other addresses.
3.2. Turn off the source server.
3.3. On the destination server, set the IP addresses (private and public) and the hostname to initial values from the source server.
3.4. Restart the destination server to start it with new IP addresses.
4. Re-register the MySQL node in OA Provider Panel.
4.1. Go to OA Provider Panel > Operations > Infrastructure > Service Nodes > MySQL node > Reregister, specify the "root" system user with the password, and click Reregister, OK.
4.2. Wait until all tasks are completed.
You can check them in OA Provider Panel > Operations > Tasks.