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.
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% /var/lib/mysql
On this node only, start MySQL (which will cause the system tables to be built):
[root@node3 ~]# service mysqld start
Initializing MySQL database: Installing MySQL system tables...
Still on the primary node only, download...