Tuesday, November 3, 2009

RedHat / CentOS Clustering Linux HA

Go to https://:8084 (replacing with the hostname of the Conga web server) and login.
*

Click the cluster tab.
*

Choose the cluster to configure.

2. Add a service

*

In the navigation bar on the left, choose Services => Add A Service.
*

Enter a descriptive Name for the service.
*

Choose whether to Automatically start this service and/or Run exclusive
*

Choose a Failover Domain.
*

Choose a Recovery Policy.
*

Optionally enter the maximum number of restarts and the restart counter timeout.

3. Add an IP Resource

*

Click Add a resource to this service.
*

Under Add a new local resource, choose IP Address.
*

Enter the IP Address that clients will use to access the MySQL database.
*

Choose whether to monitor the link for failures or not.

4. Add an LVM Resource

NOTE: This step is only required if HA-LVM is in use. If LVM will not be used at all or if clvmd is running in this cluster, then an LVM resource is not needed.

*

Under the previously created IP resource, click Add a child.
*

Under Add a new local resource, choose LVM.
*

Enter a descriptive name for the resource.
*

Fill in the Volume Group Name and Logical Volume Name.

5. Add a filesystem resource

*

Under the previously created LVM resource (or the IP resource if step 4 was skipped), click Add a child.
*

Under Add a new local resource, select File System.
*

Enter a a descriptive Name for the resource.
*

Choose the File system type.
*

Enter a Mount point, such as /var/lib/mysql.
*

Enter the Device path. If step 4 was followed then this should match the device that was entered, such as /dev/mysqlvg/datalv.
*

Enter any mount Options to use.
*

Optionally choose to Force unmount the filesystem, Reboot the host node if unmount fails, and/or Check the file system before mounting.

NOTE A MySQL resource can be created in one of two ways. Follow only one of 6a or 6b:

6a. Add a MySQL resource

*

Under the above filesystem resource, click Add a child.
*

Under Add a new local resource, select MySQL.
*

Enter a descriptive Name for the resource.
*

Enter the path to the Config File, such as /etc/my.cnf. See the above section on Configuring MySQL to Use Shared Storage for details.
*

Enter a Listen Address. In most situations this should match the IP address that was created as a resource in step #3.
*

Optionally enter any Options that should be passed to the mysqld daemon.
*

Optionally enter a Shutdown Wait in seconds. This determines the length of time that rgmanager will wait while stopping the resource before determining something has gone wrong and throwing an error.

6b. Add a script resource

*

Under the above filesystem resource, click Add a child.
*

Under Add a new local resource, select Script.
*

Enter a descriptive name for the resource.
*

Enter the Full path to script file, such as /etc/init.d/mysqld.

7. Save the service

*

Click Submit at the bottom of the page

Creating a service in Red Hat Enterprise Linux 4 and 5 using system-config-cluster

1. Open the system-config-cluster tool by running

# system-config-cluster

in a terminal.

2. Create a Service

*

In the Cluster Configuration tab, highlight the Services group.
*

Click the Create a Service button on the right side.
*

Enter a descriptive Name for the service.
*

Choose whether to Autostart This Service and/or Run Exclusive.
*

Select a Failover Domain in the upper right corner.
*

Select a Recovery Policy.

3. Add an IP resource

*

Click the Create a new resource for this service button.
*

Select IP Adress from the drop-down menu.
*

Enter the IP address that clients will connect to the MySQL service on.
*

Choose whether to monitor the link for failures or not.
*

Click OK.

4. Add an LVM resource

NOTE: This step is only required if HA-LVM is in use. If LVM will not be used at all or if clvmd is running in this cluster, then an LVM resource is not needed.

*

Highlight the previously created IP resource.
*

Click Attach a new Private Resource to the Selection.
*

Select LVM from the drop-down menu.
*

Enter a descriptive Name for the resource.
*

Enter the Volume Group Name and Logical Volume Name.
*

Click OK.

5. Add a filesystem resource

*

Highlight the previously created LVM resource (or the IP resource if step #4 was skipped).
*

Click Attach a new Private Resource to the Selection.
*

Select File System from the drop-down menu.
*

Enter a descriptive Name for the resource.
*

Choose the File System Type.
*

Enter the Mount Point, such as /var/lib/mysql.
*

Enter the Device path. If step 4 was followed then this should match the device that was entered, such as /dev/mysqlvg/datalv.
*

Optionally enter any mount Options that should be used.
*

Optionally choose to Force unmount the filesystem, Reboot the host node if unmount fails, and/or Check the file system before mounting.
*

Click OK.

NOTE A MySQL resource can be created in one of two ways. Follow only one of 6a or 6b:

6a. Add a MySQL resource

*

Highlight the previously created filesystem resource.
*

Click Attach a new Private Resource to the selection.
*

Select MySQL Server from the drop-down menu.
*

Enter a descriptive Name for the resource.
*

Enter the path to the Config File, such as /etc/my.cnf.
*

Enter a Listen Address. In most situations this should match the IP address that was created as a resource in step #3.
*

Optionally enter any Options that should be passed to the mysqld daemon.
*

Optionally enter a Shutdown Wait in seconds. This determines the length of time that rgmanager will wait while stopping the resource before determining something has gone wrong and throwing an error.
*

Click OK.

6b. Add a script resource

*

Highlight the previously created filesystem resource.
*

Click Attach a new Private Resource to the selection.
*

Select Script from the drop-down menu.
*

Enter a descriptive Name for the resource.
*

Enter the path for the File that will be used as the script, such as /etc/init.d/mysqld.
*

Click OK.

7. In the Service Management dialog, click Close.

8. To save the changes to the local configuration file, choose File => Save.

9. To propagate the changes to the rest of the cluster and allow for the service to be started, click Send to Cluster.

Service Configuration Examples

Red Hat Enterprise Linux

A service example from /etc/cluster.xml for Red Hat Enterprise Linux 3 is as follows:

Red Hat Enterprise Linux

The following is a service example from /etc/cluster/cluster.conf for Red Hat Enterprise Linux 4 or 5 using the rgmanager MySQL resource agent:

or alternatively using a script resource:

Apache Clustering HA

1.

Select the Services tab and click New. The Service properties dialog box is displayed.
a. Give the service a name (for example, httpd).
b. Choose httpd-domain from the Failover Domain list.
c. Specify a value in the Check Interval field.
d. Specify /etc/rc.d/init.d/httpd in the User Script field.
e. Click OK.

a. Choose Add Device and click OK. The Device properties dialog box is displayed.
b. Enter the device special file name in the Device Special File field (for example,
/dev/hda7).
c. Enter the mount point in the Mount Point field (for example, /var/www/html/).
d. Choose ext3 from the FS Type list.
e. Enter rw in the Options field.
f. Ensure that Force Unmount is checked, and click OK.

2.

Select the httpd service on the Services tab and click Add Child. The Add Device or Service IP Address dialog box is displayed.
a. Choose Add Service IP Address and click OK. The Service IP Address properties dialog box is displayed.
b. In the IP Address field, specify an IP address, which the cluster infrastructure binds to the network interface on the cluster system that runs the httpd service (for example, 192.168.26.10).
c. Specify a netmask of None in the Netmask field.
d. In the Broadcast field, specify an IP address of None for broadcasting on the cluster subnet.
e. Click OK.

3.

Ensure that the httpd service is still selected in the Services tab and click Add Child. The Add Device or Service IP Address dialog box is displayed.
4.

Choose File => Save to save your changes.
5.

To start the Apache HTTP Server within the Cluster Status Tool, highlight the service and click Enable.