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 with YaST 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:
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 A.1. Creating an IP Address Cluster Resource
Start the Pacemaker GUI and log in to the cluster as described in Section 5.1.1, “Connecting to a Cluster”.
In the left pane, switch to the view and in the right pane, select the group to modify and click . The next window shows the basic group parameters and the meta attributes and primitives already defined for that resource.
Click the tab and click .
In the next dialog, set the following parameters to add an IP address as sub-resource of the group:
Enter a unique ID. For example,
myIP.
From the list, select as resource agent class.
As of your OCF resource agent, select .
From the list, select as resource agent.
Click .
In the tab, select the entry and click (or double-click the entry).
As , enter the desired IP address, for
example, 10.10.0.1 and click .
a new instance attribute and specify
nic as and
eth0 as , then click
.
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.
Once all parameters are set according to your wishes, click 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 in the left pane. In the right pane, right-click the resource and select (or start it from the toolbar).
To migrate the IP address resource to another node
(saturn) proceed as follows:
Procedure A.2. Migrating Resources to Another Node
Switch to the view in the left pane, then right-click the IP address resource in the right pane and select .
In the new window, select saturn from the drop-down list to move the selected resource to the node
saturn.
If you want to migrate the resource only temporarily, activate and enter the time frame for which the resource should migrate to the new node.
Click to confirm the migration.
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, OCF scripts, or legacy Heartbeat 1 resources. All
resources can be configured with the crm command or as
XML in the CIB (Cluster Information Base) in the
resources section. For an overview of available
resources, look at Chapter 19, HA OCF Agents.
To add an IP address 10.10.0.1
as a resource to the current configuration, use the crm
command:
Procedure A.3. Creating an IP Address Cluster Resource
Open a shell and become root.
Enter crm configure to open the
internal shell.
Create an IP address resource:
crm(live)configure# resource primitive myIP ocf:heartbeat:IPaddr params ip=10.10.0.1
![]() | |
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: