Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
Applies to SUSE Linux Enterprise High Availability Extension 11 SP4

B Example of Setting Up a Simple Testing Resource

This chapter provides a basic example for the configuration of a simple resource: an IP address. It demonstrates both approaches to do so, using either the Pacemaker GUI or the crm command line tool.

For the following example, we assume that you have set up your cluster as described in Chapter 3, Installation and Basic Setup and that your cluster consists of at least two nodes. For an introduction and overview of how to configure cluster resources with the Pacemaker GUI and the crm shell, refer to the following chapters:

B.1 Configuring a Resource with the GUI

Creating a sample cluster resource and migrating it to another server can help you test to ensure your cluster is functioning properly. A simple resource to configure and migrate is an IP address.

Procedure B.1: Creating an IP Address Cluster Resource
  1. Start the Pacemaker GUI and log in to the cluster as described in Section 6.1.1, “Logging in to a Cluster”.

  2. In the left pane, switch to the Resources view and in the right pane, select the group to modify and click Edit. The next window shows the basic group parameters and the meta attributes and primitives already defined for that resource.

  3. Click the Primitives tab and click Add.

  4. In the next dialog, set the following parameters to add an IP address as sub-resource of the group:

    1. Enter a unique ID. For example, myIP.

    2. From the Class list, select ocf as resource agent class.

    3. As Provider of your OCF resource agent, select heartbeat.

    4. From the Type list, select IPaddr as resource agent.

    5. Click Forward.

    6. In the Instance Attribute tab, select the IP entry and click Edit (or double-click the IP entry).

    7. As Value, enter the desired IP address, for example, and click OK.

    8. Add a new instance attribute and specify nic as Name and eth0 as Value, then click OK.

      The name and value are dependent on your hardware configuration and what you chose for the media configuration during the installation of the High Availability Extension software.

  5. Once all parameters are set according to your wishes, click OK to finish the configuration of that resource. The configuration dialog is closed and the main window shows the modified resource.

To start the resource with the Pacemaker GUI, select Management in the left pane. In the right pane, right-click the resource and select Start (or start it from the toolbar).

To migrate the IP address resource to another node (saturn) proceed as follows:

Procedure B.2: Migrating Resources to Another Node
  1. Switch to the Management view in the left pane, then right-click the IP address resource in the right pane and select Migrate Resource.

  2. In the new window, select saturn from the To Node drop-down list to move the selected resource to the node saturn.

  3. If you want to migrate the resource only temporarily, activate Duration and enter the time frame for which the resource should migrate to the new node.

  4. Click OK to confirm the migration.

B.2 Configuring a Resource Manually

Resources are any type of service that a computer provides. Resources are known to High Availability when they may be controlled by RAs (Resource Agents), which are LSB scripts or OCF scripts. All resources can be configured with the crm command or as XML in the CIB (Cluster Information Base) in the resources section.

To add an IP address as a resource to the current configuration, use the crm command:

Procedure B.3: Creating an IP Address Cluster Resource
  1. Open a shell and become root.

  2. Enter crm configure to open the internal shell.

  3. Create an IP address resource:

    crm(live)configure# resourceprimitive myIP ocf:heartbeat:IPaddr params ip=

When configuring a resource with High Availability, the same resource should not be initialized by init. High availability is be responsible for all service start or stop actions.

If the configuration was successful, a new resource appears in crm_mon that is started on a random node of your cluster.

To migrate a resource to another node, do the following:

Procedure B.4: Migrating Resources to Another Node
  1. Start a shell and become the user root.

  2. Migrate your resource myip to node saturn:

    crm resource migrate myIP saturn
Print this page