cmmakepkg -s MySQL1.cntl (control template)

5.Using any editor modify the package templates with your specific information, as described in the preceding section“Package Configuration File and Control Script” (page 92) of this chapter.

6.Change the owner and group of the package directory to the "mysql" user. For Example:

chown mysql:mysql /etc/cmcluster/pkg/MySQL1

7.Ensure both root and mysql users have read, write, and execute permissions for the package directory.

8.Distribute the package directory to all nodes in the cluster.

9.Apply the Serviceguard package configuration using the command cmapplyconf -P MySQL1.conf

10.Enable package switching for MySQL package using:cmmodpkg -e -n node1 -n node2 mysql_1 cmmodpkg -e mysql_1

11.The package should now be running. If it is not, start the package by issuing the cmrunpkg command.

cmrunpkg mysql_1

Repeat these procedures to create multiple MySQL instances running in the Serviceguard environment.

Database Maintenance

There might be situations, when the MySQL database has to be taken down for maintenance purposes like changing configuration, without having the instance to migrate to standby node. The following procedure should be followed during maintenance:

NOTE: The example assumes that the package name is mysql_1, package directory is /etc/ cmcluster/pkg/MySQL1 and the MySQL DATADIR is configured as/MySQL_1/mysql.

Disable the failover of the package through the cmmodpkg command. $ cmmodpkg -d mysql_1

Pause the monitor script.

Create an empty file /etc/cmcluster/pkg/MySQL1/mysql.debug as shown below: $ touch /etc/cmcluster/pkg/MySQL1/mysql.debug

Toolkit monitor script which continuously monitors MySQL process, would now stop monitoring this daemon process. A message "MySQL toolkit pausing monitoring and entering maintenance mode" appears in the Serviceguard Package Control script log.

If required, stop the MySQL database instance as shown below: $ /etc/cmcluster/pkg/MySQL1/toolkit.sh stop

Perform maintenance actions (For example, changing the configuration parameters in the parameter file of the MySQL instance. If this file is changed, remember to distribute the new file to all cluster nodes).

Start the MySQL database instance again if you stopped it: $ /etc/cmcluster/pkg/MySQL1/toolkit.sh start

Allow monitoring scripts to continue normally as shown below: $ rm -f /etc/cmcluster/pkg/MySQL1/mysql.debug

Database Maintenance 95