5.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 configuring a MySQL database service is as follows:

5.3.1. MySQL and the Cluster Configuration Tool

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

  1. Start the Cluster Configuration Tool by choosing Main Menu => System Settings => Server Settings => Cluster or by typing redhat-config-cluster at a shell prompt. The Cluster Status Tool appears by default.

  2. Start the Cluster Configuration Tool by selecting Cluster => Configure from the Cluster Status Tool menus.

  3. Click the Services tab.

  4. Add the MySQL service.

    • Click New. The Service dialog appears.

      Figure 5-2. Adding a Service

    • Enter a Service Name for the MySQL service.

    • Select a Failover Domain or leave it as None.

    • Type a quantity (seconds) in the Check Interval box if you want to check the health of the MySQL service through the status directive of the mysqld init script.

    • Enter a User Script, such as /etc/init.d/mysqld.

    • Click OK.

  5. Add an IP address for the MySQL service.

    • Select the MySQL service and click Add Child.

    • Select Add Service IP Address and click OK. The Service IP Address dialog appears.

    • Enter an IP Address.

    • Enter a Netmask, or leave it None.

    • Enter a Broadcast Address, or leave it None.

    • Click OK.

  6. Add a device for the MySQL service.

    • Select the MySQL service and click Add Child.

    • Select Add Device and click OK. The Device dialog appears.

    • Enter the Device Special File (for example, /dev/sdc3).

    • In the Mount Point field, enter /var/lib/mysql.

    • Select the file system type in FS Type or leave it blank.

    • Enter any mount point Options, including rw (read-write).

    • Check or uncheck Force Unmount.

    • Click OK.

  7. Choose File => Save to save the MySQL service.