Manually moving services within a DRBD cluster

In this recipe, we will take the DRBD cluster configured in the previous recipe, install a MYSQL server on it, and show how it is possible to move the MySQL service from one node to another quickly and safely.

Getting ready

Ensure that you have completed the previous recipe and that your two nodes are both in sync (drbd-overview showing both nodes as UpToDate).

In the previous recipe we installed the MySQL server. Now, establish which node is active (which should have /var/lib/mysql mounted on top of the DRBD volume during the last recipe) by executing the df command on each node and checking to see which has the MySQL volume mounted:

 [root@node3 ~]# df -h | grep mysql /dev/drbd0 5.0G 139M 4.6G 3% ...

Get High Availability MySQL Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.