Resources are any type of service that a computer provides.
Resources are known to Heartbeat when they may be controlled by RAs
(Resource Agents), which are LSB scripts, OCF scripts,
or legacy Heartbeat 1 resources. All resources are configured in the CIB
(Cluster Information Base) in the resources section.
For an overview of available resources, look at
Appendix A, HB OCF Agents.
To add a resource to the current configuration, first
write an XML file with the specific date for this resource. For
example, to add the IP address
10.10.0.1 to your cluster, use the
following example:
<primitive id="ip_1"class="ocf"
type="IPaddr"
provider="heartbeat"
> <instance_attributes> <attributes>
<nvpair name="ip" value="10.10.0.1"
/> </attributes> </instance_attributes> </primitive>
The value of the | |
The three attributes | |
All the attributes for a resource agent are entered in a list of
| |
In this example, the RA attribute |
![]() | Note |
|---|---|
When configuring a resource with Heartbeat, the same resource should not be initialized by init. Heartbeat should be responsible for all service start or stop actions. | |
To add this IPaddr configuration to the cluster,
first save the configuration to a file named
ip_1.xml. Add this file to the
cluster configuration with the command:
cibadmin -o resources -C -x ip_1.xml
If the configuration was successful, a new resource appears in crm_mon that is started on a random node of your cluster.