6.3. Setting Up a MySQL Service

A database service can serve highly-available data to a MySQL database application. The application can then provide network access to database client systems, such as Web servers. If the service fails over, the application accesses the shared database data through the new cluster system. A network-accessible database service is usually assigned one IP address, which is failed over along with the service to maintain transparent access for clients.

An example of a MySQL database service configuration is as follows:

6.3.1. MySQL and the Cluster Configuration Tool

To add a MySQL service using the Cluster Configuration Tool, perform the following:

  1. Add the init script for the MySQL application service.

    • Select the Resources property and click Create a Resource.

    • In the Resource Configuration dialog, select Script from the drop-down menu.

    • Enter a Name to be associated with the MySQL service.

    • Enter the path to the MySQL init script (such as /etc/init.d/mysqld in the File (with path) field.

    • Click OK.

  2. Add an IP address for the MySQL service.

    • Select the Resources property and click Create a Resource.

    • In the Resource Configuration dialog, select IP Address from the drop-down menu.

    • Enter the IP Address to be associated with the MySQL service.

    • Make sure that the Monitor Link checkbox is left checked.

    • Click OK.

  3. Add a device for the MySQL service.

    • Select the Resources property and click Create a Resource.

    • Select GFS from the drop-down menu.

    • In the Resource Configuration dialog, enter the Name for the resource (for example, mysql-data).

    • In the Mount Point field, enter the path to which the shared GFS device is mounted (/var/lib/mysql/).

    • In the Device field, enter the block device associated with the GFS share (/dev/vg01/lvol5).

    • Enter any mount point Options, (such as rw for read-write priveleges).

    • Click OK.

  4. Click the Services property.

  5. Add the MySQL service.

    • Click Create a Service. Type a Name for the service in the Add a Service dialog.

    • In the Service Management dialog, select a Failover Domain from the drop-down menu or leave it as None.

      Figure 6-2. MySQL service management

    • Click the Add a Shared Resource to this service button. From the available list, choose each resource that you created in the previous steps. Repeat this step until all resources have been added.

    • Click OK.

  6. Choose File => Save to save the MySQL service configuration.